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
289 struct thread *thread;
293 thread = malloc(sizeof(struct thread));
294 if (!thread)
297 list_add_tail(&thread->_threads, &_threads);
298 pthread_cond_init(&thread->cond, NULL); // Accept the defaults
299 init_pi_mutex(&thread->mutex);
300 thread->id = id;
301 thread->priority = prio;
302 thread->policy = policy;
303 thread->flags = 0;
304 thread->arg = arg;
305 thread->func = func;
308 pthread_attr_init(&thread->attr);
309 pthread_attr_setinheritsched(&thread->attr, PTHREAD_EXPLICIT_SCHED);
310 pthread_attr_setschedpolicy(&thread->attr, thread->policy);
311 pthread_attr_setschedparam(&thread->attr, ¶m);
314 pthread_create(&thread->pthread, &thread->attr, func,
315 (void *)thread))) {
317 list_del(&thread->_threads);
318 pthread_attr_destroy(&thread->attr);
319 free(thread);
322 pthread_attr_destroy(&thread->attr);
368 struct thread *p, *t = NULL;
385 struct thread *p;
394 struct thread *p, *t;
402 struct thread *get_thread(int i)
404 struct thread *p;