Lines Matching refs:worker

45 	struct l9p_worker *worker = arg;  in l9p_responder()  local
48 tp = worker->ltw_tp; in l9p_responder()
52 while (STAILQ_EMPTY(&tp->ltp_replyq) && !worker->ltw_exiting) in l9p_responder()
54 if (worker->ltw_exiting) { in l9p_responder()
82 struct l9p_worker *worker = arg; in l9p_worker() local
85 tp = worker->ltw_tp; in l9p_worker()
88 while (STAILQ_EMPTY(&tp->ltp_workq) && !worker->ltw_exiting) in l9p_worker()
90 if (worker->ltw_exiting) in l9p_worker()
97 req->lr_worker = worker; in l9p_worker()
158 struct l9p_worker *worker; in l9p_threadpool_init() local
184 worker = calloc(1, sizeof(struct l9p_worker)); in l9p_threadpool_init()
185 worker->ltw_tp = tp; in l9p_threadpool_init()
186 worker->ltw_responder = i == 0; in l9p_threadpool_init()
187 error = pthread_create(&worker->ltw_thread, NULL, in l9p_threadpool_init()
188 worker->ltw_responder ? l9p_responder : l9p_worker, in l9p_threadpool_init()
189 (void *)worker); in l9p_threadpool_init()
191 free(worker); in l9p_threadpool_init()
194 if (worker->ltw_responder) in l9p_threadpool_init()
200 if (worker->ltw_responder) { in l9p_threadpool_init()
201 pthread_set_name_np(worker->ltw_thread, "9p-responder"); in l9p_threadpool_init()
204 pthread_set_name_np(worker->ltw_thread, threadname); in l9p_threadpool_init()
208 LIST_INSERT_HEAD(&tp->ltp_workers, worker, ltw_link); in l9p_threadpool_init()
403 struct l9p_worker *worker, *tmp; in l9p_threadpool_shutdown() local
405 LIST_FOREACH_SAFE(worker, &tp->ltp_workers, ltw_link, tmp) { in l9p_threadpool_shutdown()
407 worker->ltw_exiting = true; in l9p_threadpool_shutdown()
408 if (worker->ltw_responder) in l9p_threadpool_shutdown()
413 pthread_join(worker->ltw_thread, NULL); in l9p_threadpool_shutdown()
414 LIST_REMOVE(worker, ltw_link); in l9p_threadpool_shutdown()
415 free(worker); in l9p_threadpool_shutdown()