Use HIGH priority to wake blocked timers (#11269)

One contributor to some beach-balls was that the main thread was calling
block_with_timeout, but the timeout never fired.

Release Notes:

- Reduced main thread hangs under very high system load
This commit is contained in:
Conrad Irwin
2024-05-01 16:03:27 -06:00
committed by GitHub
parent 4739797e5d
commit e5b88ac8c2
3 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ impl PlatformDispatcher for MacDispatcher {
fn dispatch_after(&self, duration: Duration, runnable: Runnable) {
unsafe {
let queue =
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT.try_into().unwrap(), 0);
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH.try_into().unwrap(), 0);
let when = dispatch_time(DISPATCH_TIME_NOW as u64, duration.as_nanos() as i64);
dispatch_after_f(
when,