Skip to content

Commit 3402eba

Browse files
committed
dbg
1 parent ef4720c commit 3402eba

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/librustc/ty/maps/job.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ impl<'tcx> QueryJob<'tcx> {
9797
cycle: None,
9898
condvar: Condvar::new(),
9999
};
100+
eprintln!("[{:?}] await query {:?} condvar: {:x}",
101+
::std::thread::current().id(),
102+
self.info.query,
103+
&waiter.condvar as *const _ as usize);
100104
self.latch.await(tcx, &mut waiter);
101105

102106
match waiter.cycle {
@@ -144,6 +148,9 @@ impl<'tcx> QueryJob<'tcx> {
144148
/// This does nothing for single threaded rustc,
145149
/// as there are no concurrent jobs which could be waiting on us
146150
pub fn signal_complete(&self, tcx: TyCtxt<'_, 'tcx, '_>) {
151+
eprintln!("[{:?}] complete query {:?}",
152+
::std::thread::current().id(),
153+
self.info.query);
147154
#[cfg(parallel_queries)]
148155
self.latch.set(tcx);
149156
}
@@ -161,6 +168,10 @@ struct QueryWaiter<'a, 'tcx: 'a> {
161168
impl<'a, 'tcx> QueryWaiter<'a, 'tcx> {
162169
fn notify(&self, tcx: TyCtxt<'_, '_, '_>) {
163170
tcx.active_threads.fetch_add(1, Ordering::SeqCst);
171+
eprintln!("[{:?}] (wake) active threads: {} condvar: {:x}",
172+
::std::thread::current().id(),
173+
tcx.active_threads.load(Ordering::SeqCst),
174+
&self.condvar as *const _ as usize);
164175
self.condvar.notify_one();
165176
}
166177
}
@@ -200,6 +211,10 @@ impl QueryLatch {
200211
// Spawn a thread to handle the deadlock before we go to sleep
201212
handle_deadlock(tcx);
202213
}
214+
eprintln!("[{:?}] (await) active threads: {} condvar: {:x}",
215+
::std::thread::current().id(),
216+
tcx.active_threads.load(Ordering::SeqCst),
217+
&waiter.condvar as *const _ as usize);
203218
waiter.condvar.wait(&mut info);
204219
}
205220
}

0 commit comments

Comments
 (0)