public void UpdatePriority() { int OldPriority = ActualPriority; int CurrPriority = WantedPriority; lock (Process.ThreadSyncLock) { foreach (KThread Thread in MutexWaiters) { if (CurrPriority > Thread.WantedPriority) { CurrPriority = Thread.WantedPriority; } } } if (CurrPriority != OldPriority) { ActualPriority = CurrPriority; Process.Scheduler.Resort(this); MutexOwner?.UpdatePriority(); } }
public void UpdatePriority() { bool PriorityChanged; lock (Process.ThreadSyncLock) { int OldPriority = ActualPriority; int CurrPriority = WantedPriority; foreach (KThread Thread in MutexWaiters) { int WantedPriority = Thread.WantedPriority; if (CurrPriority > WantedPriority) { CurrPriority = WantedPriority; } } PriorityChanged = CurrPriority != OldPriority; ActualPriority = CurrPriority; } if (PriorityChanged) { Process.Scheduler.Resort(this); MutexOwner?.UpdatePriority(); } }
public void UpdatePriority() { int OldPriority = ActualPriority; int CurrPriority = WantedPriority; if (NextMutexThread != null && CurrPriority > NextMutexThread.WantedPriority) { CurrPriority = NextMutexThread.WantedPriority; } if (CurrPriority != OldPriority) { ActualPriority = CurrPriority; UpdateWaitList(); MutexOwner?.UpdatePriority(); } }