Lines Matching defs:thread
67 #include <kern/thread.h>
630 thread_t thread = current_thread();
638 if (thread->pending_promoter[thread->pending_promoter_index] == mutex) {
639 thread->pending_promoter[thread->pending_promoter_index] = NULL;
640 if (thread->pending_promoter_index > 0)
641 thread->pending_promoter_index--;
649 thread_lock(thread);
650 thread->promotions++;
651 thread->sched_mode |= TH_MODE_PROMOTED;
652 if (thread->sched_pri < priority) {
655 thread->sched_pri, priority, 0, (int)lck, 0);
657 set_sched_pri(thread, priority);
659 thread_unlock(thread);
680 thread_t thread = current_thread();
691 if (thread != holder)
694 if (thread->promotions > 0) {
697 thread_lock(thread);
698 if ( --thread->promotions == 0 &&
699 (thread->sched_mode & TH_MODE_PROMOTED) ) {
700 thread->sched_mode &= ~TH_MODE_PROMOTED;
701 if (thread->sched_mode & TH_MODE_ISDEPRESSED) {
704 thread->sched_pri, DEPRESSPRI, 0, (int)lck, 0);
706 set_sched_pri(thread, DEPRESSPRI);
709 if (thread->priority < thread->sched_pri) {
713 thread->sched_pri, thread->priority,
717 compute_priority(thread, FALSE);
720 thread_unlock(thread);