Lines Matching refs:thread

69 #include <kern/thread.h>
202 void lck_rw_clear_promotions_x86(thread_t thread);
378 panic("Spinlock acquisition timed out: lock=%p, lock owner thread=0x%lx, current_thread: %p, lock owner active on CPU 0x%x, current owner: 0x%lx", l, lowner, current_thread(), lock_cpu, (uintptr_t)l->interlock.lock_data);
523 * ignore this test if the locking thread is 0.
530 printf(" current thread %p (new attempt at pc %p)\n",
601 panic("%s: unlocking lock 0x%p, owned by thread %p",
1080 thread_t thread;
1104 thread = current_thread();
1105 rwlock_count = thread->rwlock_count--;
1108 panic("rw lock count underflow for thread %p", thread);
1111 if ((rwlock_count == 1 /* field now 0 */) && (thread->sched_flags & TH_SFLAG_RW_PROMOTED)) {
1113 lck_rw_clear_promotion(thread);
1311 thread_t thread = current_thread();
1315 rwlock_count = thread->rwlock_count--;
1318 panic("rw lock count underflow for thread %p", thread);
1321 if ((rwlock_count == 1 /* field now 0 */) && (thread->sched_flags & TH_SFLAG_RW_PROMOTED)) {
1323 lck_rw_clear_promotion(thread);
1562 lck_rw_clear_promotions_x86(thread_t thread)
1566 panic("%u rw lock(s) held on return to userspace for thread %p", thread->rwlock_count, thread);
1569 thread->rwlock_count = 0;
1570 lck_rw_clear_promotion(thread);
1771 thread_t thread = current_thread();
1775 thread_tid(thread), thread->promotions, thread->sched_flags & TH_SFLAG_PROMOTED, 0, 0);
1777 if (thread->promotions > 0) {
1780 thread_lock(thread);
1782 if (--thread->promotions == 0 && (thread->sched_flags & TH_SFLAG_PROMOTED)) {
1784 thread->sched_flags &= ~TH_SFLAG_PROMOTED;
1786 if (thread->sched_flags & TH_SFLAG_RW_PROMOTED) {
1788 } else if (thread->sched_flags & TH_SFLAG_DEPRESSED_MASK) {
1790 thread->sched_pri, DEPRESSPRI, 0, mutex, 0);
1792 set_sched_pri(thread, DEPRESSPRI);
1795 if (thread->priority < thread->sched_pri) {
1797 thread->sched_pri, thread->priority, 0, mutex, 0);
1799 SCHED(compute_priority)(thread, FALSE);
1803 thread_unlock(thread);
1818 * thread->was_promoted_on_wakeup != 0)...
1826 thread_t thread;
1831 mutex, thread->was_promoted_on_wakeup, mutex->lck_mtx_waiters, mutex->lck_mtx_pri, 0);
1838 thread = (thread_t)mutex->lck_mtx_owner; /* faster then current_thread() */
1840 if (thread->sched_pri < priority || thread->was_promoted_on_wakeup) {
1843 thread->sched_pri, priority, thread->was_promoted_on_wakeup, mutex, 0);
1846 thread_lock(thread);
1848 if (thread->sched_pri < priority) {
1851 set_sched_pri(thread, priority);
1856 thread->promotions++;
1857 thread->sched_flags |= TH_SFLAG_PROMOTED;
1859 thread->was_promoted_on_wakeup = 0;
1861 thread_unlock(thread);
2001 /* holder priority may have been bumped by another thread
2009 * thread above the MAXPRI_PROMOTE band