Lines Matching refs:thread

42 	pthread_thread* thread = (pthread_thread*)_thread;
46 pthread_exit(thread->entry(thread->entry_argument));
57 pthread_thread* thread = pthread_self();
69 __pthread_key_call_destructors(thread);
71 if ((atomic_or(&thread->flags, THREAD_DEAD) & THREAD_DETACHED) != 0)
72 free(thread);
79 pthread_thread* thread = (pthread_thread*)malloc(sizeof(pthread_thread));
80 if (thread == NULL)
83 __init_pthread(thread, entry, data);
85 return thread;
90 __init_pthread(pthread_thread* thread, void* (*entry)(void*), void* data)
92 thread->entry = entry;
93 thread->entry_argument = data;
94 thread->exit_value = NULL;
95 thread->cleanup_handlers = NULL;
96 thread->flags = THREAD_CANCEL_ENABLED;
97 // thread cancellation enabled, but deferred
99 memset(thread->specific, 0, sizeof(thread->specific));
105 pthread_t thread, status_t (*entryFunction)(void*, void*),
126 attributes->pthread = thread;
129 if (thread != NULL && attr->detach_state == PTHREAD_CREATE_DETACHED)
130 thread->flags |= THREAD_DETACHED;
153 pthread_thread* thread = __allocate_pthread(startRoutine, arg);
154 if (thread == NULL)
158 status_t error = __pthread_init_creation_attributes(attr, thread,
159 &pthread_thread_entry, NULL, thread, "pthread func", &attributes);
161 free(thread);
165 thread->id = _kern_spawn_thread(&attributes);
166 if (thread->id < 0) {
168 free(thread);
173 *_thread = thread;
174 resume_thread(thread->id);
183 pthread_thread* thread = get_user_thread()->pthread;
184 if (thread == NULL)
187 return thread;
199 pthread_join(pthread_t thread, void** _value)
204 error = wait_for_thread(thread->id, &dummy);
211 *_value = thread->exit_value;
213 if ((atomic_or(&thread->flags, THREAD_DETACHED) & THREAD_DEAD) != 0)
214 free(thread);
229 pthread_kill(pthread_t thread, int sig)
231 status_t status = send_signal(thread->id, (uint)sig);
244 pthread_detach(pthread_t thread)
248 if (thread == NULL)
251 flags = atomic_or(&thread->flags, THREAD_DETACHED);
256 free(thread);
281 pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param)
284 status_t status = _kern_get_thread_info(thread->id, &info);
299 pthread_setschedparam(pthread_t thread, int policy,
309 status = _kern_set_thread_priority(thread->id, param->sched_priority);
318 // #pragma mark - Haiku thread API bridge
322 get_pthread_thread_id(pthread_t thread)
324 return thread->id;
329 __pthread_getname_np(pthread_t thread, char* buffer, size_t length)
332 status_t status = _kern_get_thread_info(thread->id, &info);
342 __pthread_setname_np(pthread_t thread, const char* name)
344 status_t status = _kern_rename_thread(thread->id, name);