- if ((thread->rwlock_count != 0) && !(LcksOpts & disLkRWPrio)) {
- integer_t priority;
-
- priority = thread->sched_pri;
-
- if (priority < thread->base_pri)
- priority = thread->base_pri;
- if (priority < BASEPRI_BACKGROUND)
- priority = BASEPRI_BACKGROUND;
-
- if ((thread->sched_pri < priority) || !(thread->sched_flags & TH_SFLAG_RW_PROMOTED)) {
- KERNEL_DEBUG_CONSTANT(
- MACHDBG_CODE(DBG_MACH_SCHED, MACH_RW_PROMOTE) | DBG_FUNC_NONE,
- (uintptr_t)thread_tid(thread), thread->sched_pri, thread->base_pri, priority, 0);
-
- thread->sched_flags |= TH_SFLAG_RW_PROMOTED;
-
- if (thread->sched_pri < priority)
- set_sched_pri(thread, priority);
- }
- }
-