get rid of tcx in deadlock handler when parallel compilation

This commit is contained in:
SparrowLii
2022-06-29 10:02:30 +08:00
parent 3b0d4813ab
commit fbca21edd2
4 changed files with 9 additions and 21 deletions

View File

@@ -492,14 +492,13 @@ fn remove_cycle(
/// There may be multiple cycles involved in a deadlock, so this searches
/// all active queries for cycles before finally resuming all the waiters at once.
#[cfg(parallel_compiler)]
pub fn deadlock<CTX: QueryContext>(tcx: CTX, registry: &rayon_core::Registry) {
pub fn deadlock(query_map: QueryMap, registry: &rayon_core::Registry) {
let on_panic = OnDrop(|| {
eprintln!("deadlock handler panicked, aborting process");
process::abort();
});
let mut wakelist = Vec::new();
let query_map = tcx.try_collect_active_jobs().unwrap();
let mut jobs: Vec<QueryJobId> = query_map.keys().cloned().collect();
let mut found_cycle = false;