Lines Matching refs:thread
19 typedef struct thread { struct
20 pthread_t thread; member
35 thread_t *thread = arg; in run_thread() local
38 if (sched_setaffinity(0, sizeof thread->cpus, &thread->cpus) < 0) in run_thread()
41 result = thread->func(thread->arg); in run_thread()
58 thread_t *thread; in create_per_cpu_threads() local
64 thread = &threads[num_threads++]; in create_per_cpu_threads()
65 thread->func = func; in create_per_cpu_threads()
66 thread->arg = arg; in create_per_cpu_threads()
67 CPU_ZERO(&thread->cpus); in create_per_cpu_threads()
68 CPU_SET(cpu, &thread->cpus); in create_per_cpu_threads()
70 err = pthread_create(&thread->thread, NULL, run_thread, thread); in create_per_cpu_threads()
93 thread_t *thread; in create_threads() local
95 thread = &threads[num_threads++]; in create_threads()
96 thread->func = func; in create_threads()
97 thread->arg = arg; in create_threads()
98 CPU_ZERO(&thread->cpus); in create_threads()
100 err = pthread_create(&thread->thread, NULL, func, arg); in create_threads()
118 pthread_join(threads[--num_threads].thread, NULL); in join_threads()