Home | History | Annotate | Download | only in src

Lines Matching defs:thread

19 typedef struct thread {
20 pthread_t thread;
31 * Helper function to run a thread on a specific set of CPUs.
35 thread_t *thread = arg;
38 if (sched_setaffinity(0, sizeof thread->cpus, &thread->cpus) < 0)
41 result = thread->func(thread->arg);
58 thread_t *thread;
64 thread = &threads[num_threads++];
65 thread->func = func;
66 thread->arg = arg;
67 CPU_ZERO(&thread->cpus);
68 CPU_SET(cpu, &thread->cpus);
70 err = pthread_create(&thread->thread, NULL, run_thread, thread);
93 thread_t *thread;
95 thread = &threads[num_threads++];
96 thread->func = func;
97 thread->arg = arg;
98 CPU_ZERO(&thread->cpus);
100 err = pthread_create(&thread->thread, NULL, func, arg);
118 pthread_join(threads[--num_threads].thread, NULL);