Lines Matching defs:thread

26 #include <thread.h>
31 Thread* thread;
37 Thread* thread;
94 thread_id thread = thread_get_current_thread_id();
96 if (thread != RECURSIVE_LOCK_HOLDER(lock)) {
99 lock->holder = thread;
111 thread_id thread = thread_get_current_thread_id();
120 if (thread != RECURSIVE_LOCK_HOLDER(lock)) {
126 lock->holder = thread;
139 panic("recursive_lock %p unlocked by non-holder thread!\n", lock);
167 thread_id thread = thread_get_current_thread_id();
169 if (thread == RECURSIVE_LOCK_HOLDER(to)) {
179 from->holder = thread;
185 to->holder = thread;
202 thread_id thread = thread_get_current_thread_id();
204 if (thread == RECURSIVE_LOCK_HOLDER(to)) {
215 to->holder = thread;
232 thread_id thread = thread_get_current_thread_id();
234 if (thread != RECURSIVE_LOCK_HOLDER(to)) {
240 to->holder = thread;
280 kprintf(" %" B_PRId32, waiter->thread->id);
297 waiter.thread = thread_get_current_thread();
309 thread_prepare_to_block(waiter.thread, 0, THREAD_BLOCK_TYPE_RW_LOCK, lock);
338 lock->holder = waiter->thread->id;
340 // unblock thread
341 thread_unblock(waiter->thread, B_OK);
343 waiter->thread = NULL;
357 // unblock thread
358 thread_unblock(waiter->thread, B_OK);
360 waiter->thread = NULL;
432 // unblock thread
433 thread_unblock(waiter->thread, B_ERROR);
452 Thread* thread = thread_get_current_thread();
454 if (thread->held_read_locks[i] == lock)
464 Thread* thread = thread_get_current_thread();
466 if (thread->held_read_locks[i] != NULL)
469 thread->held_read_locks[i] = lock;
479 Thread* thread = thread_get_current_thread();
481 if (thread->held_read_locks[i] != lock)
484 thread->held_read_locks[i] = NULL;
601 waiter.thread = thread_get_current_thread();
613 thread_prepare_to_block(waiter.thread, 0, THREAD_BLOCK_TYPE_RW_LOCK, lock);
617 if (error == B_OK || waiter.thread == NULL) {
649 // us (writers only manipulate the lock data with thread spinlock being
706 thread_id thread = thread_get_current_thread_id();
707 if (lock->holder == thread) {
719 lock->holder = thread;
731 lock->holder = thread;
745 panic("rw_lock_write_unlock(): lock %p not write-locked by this thread",
817 kprintf(" %" B_PRId32 "/%c", waiter->thread->id, waiter->writer ? 'w' : 'r');
877 // unblock thread
878 Thread* thread = waiter->thread;
879 waiter->thread = NULL;
880 thread_unblock(thread, B_ERROR);
929 mutex_transfer_lock(mutex* lock, thread_id thread)
933 panic("mutex_transfer_lock(): current thread is not the lock holder!");
934 lock->holder = thread;
984 panic("_mutex_lock(): double lock of %p by thread %" B_PRId32, lock,
997 waiter.thread = thread_get_current_thread();
1008 thread_prepare_to_block(waiter.thread, 0, THREAD_BLOCK_TYPE_MUTEX, lock);
1014 ASSERT(lock->holder == waiter.thread->id);
1028 panic("_mutex_unlock() failure: thread %" B_PRId32 " is trying to "
1043 // Already set the holder to the unblocked thread. Besides that this
1047 lock->holder = waiter->thread->id;
1050 // unblock thread
1051 thread_unblock(waiter->thread, B_OK);
1100 panic("_mutex_lock(): double lock of %p by thread %" B_PRId32, lock,
1113 waiter.thread = thread_get_current_thread();
1124 thread_prepare_to_block(waiter.thread, 0, THREAD_BLOCK_TYPE_MUTEX, lock);
1131 ASSERT(lock->holder == waiter.thread->id);
1134 // If the lock was destroyed, our "thread" entry will be NULL.
1135 if (waiter.thread == NULL)
1139 // if we resume due to a timeout before our thread is set to NULL.
1171 ASSERT(lock->holder == waiter.thread->id);
1208 kprintf(" %" B_PRId32, waiter->thread->id);