Lines Matching refs:thread
142 thread_init (struct thread_node *thread, const pthread_attr_t *attr, clockid_t clock_id) in thread_init() argument
145 thread->attr = *attr; in thread_init()
148 pthread_attr_init (&thread->attr); in thread_init()
149 pthread_attr_setdetachstate (&thread->attr, PTHREAD_CREATE_DETACHED); in thread_init()
152 thread->exists = 0; in thread_init()
153 INIT_LIST_HEAD (&thread->timer_queue); in thread_init()
154 pthread_cond_init (&thread->cond, 0); in thread_init()
155 thread->current_timer = 0; in thread_init()
156 thread->captured = pthread_self (); in thread_init()
157 thread->clock_id = clock_id; in thread_init()
211 thread_deinit (struct thread_node *thread) in thread_deinit() argument
213 assert (list_isempty (&thread->timer_queue)); in thread_deinit()
214 pthread_cond_destroy (&thread->cond); in thread_deinit()
228 struct thread_node *thread = thread_links2ptr (node); in __timer_thread_alloc() local
230 thread_init (thread, desired_attr, clock_id); in __timer_thread_alloc()
232 return thread; in __timer_thread_alloc()
242 __timer_thread_dealloc (struct thread_node *thread) in __timer_thread_dealloc() argument
244 thread_deinit (thread); in __timer_thread_dealloc()
245 list_unlink (&thread->links); in __timer_thread_dealloc()
246 list_append (&thread_free_list, &thread->links); in __timer_thread_dealloc()
263 struct thread_node *thread = val; in thread_cleanup() local
266 assert (thread != &__timer_signal_thread_rclk); in thread_cleanup()
270 thread->exists = 0; in thread_cleanup()
273 thread->current_timer = 0; in thread_cleanup()
275 if (list_isempty (&thread->timer_queue)) in thread_cleanup()
276 __timer_thread_dealloc (thread); in thread_cleanup()
278 (void) __timer_thread_start (thread); in thread_cleanup()
283 pthread_cond_broadcast (&thread->cond); in thread_cleanup()
437 __timer_thread_queue_timer (struct thread_node *thread, in __timer_thread_queue_timer() argument
443 for (iter = list_first (&thread->timer_queue); in __timer_thread_queue_timer()
444 iter != list_null (&thread->timer_queue); in __timer_thread_queue_timer()
462 __timer_thread_start (struct thread_node *thread) in __timer_thread_start() argument
467 assert (!thread->exists); in __timer_thread_start()
468 thread->exists = 1; in __timer_thread_start()
473 if (pthread_create (&thread->id, &thread->attr, in __timer_thread_start()
474 (void *(*) (void *)) thread_func, thread) != 0) in __timer_thread_start()
476 thread->exists = 0; in __timer_thread_start()
487 __timer_thread_wakeup (struct thread_node *thread) in __timer_thread_wakeup() argument
489 pthread_cond_broadcast (&thread->cond); in __timer_thread_wakeup()
543 timer->thread = NULL; /* Break association between timer and thread. */ in __timer_dealloc()