Lines Matching refs:tn
310 struct sigev_thread *tn;
321 tn = malloc(sizeof(*tn));
322 tn->tn_cur = NULL;
323 tn->tn_lwpid = -1;
324 tn->tn_refcount = 1;
325 _pthread_cond_init(&tn->tn_cv, NULL);
329 LIST_INSERT_HEAD(&sigev_threads, tn, tn_link);
339 ret = _pthread_create(&tn->tn_thread, &sigev_default_attr,
340 sigev_service_loop, tn);
345 LIST_REMOVE(tn, tn_link);
347 free(tn);
348 tn = NULL;
353 while (tn->tn_lwpid == -1)
354 _pthread_cond_wait(&tn->tn_cv, sigev_list_mtx);
357 return (tn);
371 struct sigev_thread *tn;
377 tn = arg;
378 thr_self(&tn->tn_lwpid);
380 _pthread_cond_broadcast(&tn->tn_cv);
389 if (tn->tn_refcount == 0) {
390 LIST_REMOVE(tn, tn_link);
392 free(tn);
410 tn->tn_cur = sn;
412 tn->tn_cur = NULL;
427 } else if (tn->tn_cur) {
429 while (tn->tn_cur)
430 _pthread_cond_wait(&tn->tn_cv, sigev_list_mtx);