Lines Matching refs:worker

47 	struct l9p_worker *worker = arg;  in l9p_responder()  local
50 tp = worker->ltw_tp; in l9p_responder()
56 while (STAILQ_EMPTY(&tp->ltp_replyq) && !worker->ltw_exiting) { in l9p_responder()
60 if (worker->ltw_exiting) { in l9p_responder()
89 struct l9p_worker *worker = arg; in l9p_worker() local
92 tp = worker->ltw_tp; in l9p_worker()
96 while (STAILQ_EMPTY(&tp->ltp_workq) && !worker->ltw_exiting) { in l9p_worker()
100 if (worker->ltw_exiting) in l9p_worker()
107 req->lr_worker = worker; in l9p_worker()
169 struct l9p_worker *worker; in l9p_threadpool_init() local
207 worker = calloc(1, sizeof(struct l9p_worker)); in l9p_threadpool_init()
209 if (worker == NULL) in l9p_threadpool_init()
212 worker->ltw_tp = tp; in l9p_threadpool_init()
213 worker->ltw_responder = i == 0; in l9p_threadpool_init()
214 error = pthread_create(&worker->ltw_thread, NULL, in l9p_threadpool_init()
215 worker->ltw_responder ? l9p_responder : l9p_worker, in l9p_threadpool_init()
216 (void *)worker); in l9p_threadpool_init()
218 free(worker); in l9p_threadpool_init()
221 if (worker->ltw_responder) in l9p_threadpool_init()
227 if (worker->ltw_responder) { in l9p_threadpool_init()
228 pthread_set_name_np(worker->ltw_thread, "9p-responder"); in l9p_threadpool_init()
231 pthread_set_name_np(worker->ltw_thread, threadname); in l9p_threadpool_init()
234 if (worker->ltw_responder) { in l9p_threadpool_init()
235 (void) pthread_setname_np(worker->ltw_thread, in l9p_threadpool_init()
242 (void) pthread_setname_np(worker->ltw_thread, in l9p_threadpool_init()
247 LIST_INSERT_HEAD(&tp->ltp_workers, worker, ltw_link); in l9p_threadpool_init()
449 struct l9p_worker *worker, *tmp; in l9p_threadpool_shutdown() local
451 LIST_FOREACH_SAFE(worker, &tp->ltp_workers, ltw_link, tmp) { in l9p_threadpool_shutdown()
454 worker->ltw_exiting = true; in l9p_threadpool_shutdown()
455 if (worker->ltw_responder) in l9p_threadpool_shutdown()
460 (void) pthread_join(worker->ltw_thread, NULL); in l9p_threadpool_shutdown()
461 LIST_REMOVE(worker, ltw_link); in l9p_threadpool_shutdown()
462 free(worker); in l9p_threadpool_shutdown()