Lines Matching defs:thread
34 * 2006-May-08: Added atomic_{inc,set,get}, thread struct, debug function,
39 * 2008-Jan-10: Added RR thread support to tests -- Chirag Jog
292 struct thread *thread;
296 thread = malloc(sizeof(struct thread));
297 if (!thread)
300 list_add_tail(&thread->_threads, &_threads);
301 pthread_cond_init(&thread->cond, NULL); // Accept the defaults
302 init_pi_mutex(&thread->mutex);
303 thread->id = id;
304 thread->priority = prio;
305 thread->policy = policy;
306 thread->flags = 0;
307 thread->arg = arg;
308 thread->func = func;
311 pthread_attr_init(&thread->attr);
312 pthread_attr_setinheritsched(&thread->attr, PTHREAD_EXPLICIT_SCHED);
313 pthread_attr_setschedpolicy(&thread->attr, thread->policy);
314 pthread_attr_setschedparam(&thread->attr, ¶m);
317 pthread_create(&thread->pthread, &thread->attr, func,
318 (void *)thread))) {
320 list_del(&thread->_threads);
321 pthread_attr_destroy(&thread->attr);
322 free(thread);
325 pthread_attr_destroy(&thread->attr);
371 struct thread *p, *t = NULL;
389 struct thread *p;
398 struct thread *p, *t;
407 struct thread *get_thread(int i)
409 struct thread *p;