We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbcf765 commit 14786ceCopy full SHA for 14786ce
compiler/rustc_query_system/src/query/job.rs
@@ -506,9 +506,15 @@ pub fn break_query_cycles(query_map: QueryMap, registry: &rayon_core::Registry)
506
);
507
}
508
509
- // FIXME: Ensure this won't cause a deadlock before we return
+ // Mark all the thread we're about to wake up as unblocked. This needs to be done before
510
+ // we wake the threads up as otherwise Rayon could detect a deadlock if a thread we
511
+ // resumed fell asleep and this thread had yet to mark the remaining threads as unblocked.
512
+ for _ in 0..wakelist.len() {
513
+ rayon_core::mark_unblocked(registry);
514
+ }
515
+
516
for waiter in wakelist.into_iter() {
- waiter.notify(registry);
517
+ waiter.condvar.notify_one();
518
519
520
0 commit comments