@@ -97,6 +97,10 @@ impl<'tcx> QueryJob<'tcx> {
97
97
cycle : None ,
98
98
condvar : Condvar :: new ( ) ,
99
99
} ;
100
+ eprintln ! ( "[{:?}] await query {:?} condvar: {:x}" ,
101
+ :: std:: thread:: current( ) . id( ) ,
102
+ self . info. query,
103
+ & waiter. condvar as * const _ as usize ) ;
100
104
self . latch . await ( tcx, & mut waiter) ;
101
105
102
106
match waiter. cycle {
@@ -144,6 +148,9 @@ impl<'tcx> QueryJob<'tcx> {
144
148
/// This does nothing for single threaded rustc,
145
149
/// as there are no concurrent jobs which could be waiting on us
146
150
pub fn signal_complete ( & self , tcx : TyCtxt < ' _ , ' tcx , ' _ > ) {
151
+ eprintln ! ( "[{:?}] complete query {:?}" ,
152
+ :: std:: thread:: current( ) . id( ) ,
153
+ self . info. query) ;
147
154
#[ cfg( parallel_queries) ]
148
155
self . latch . set ( tcx) ;
149
156
}
@@ -161,6 +168,10 @@ struct QueryWaiter<'a, 'tcx: 'a> {
161
168
impl < ' a , ' tcx > QueryWaiter < ' a , ' tcx > {
162
169
fn notify ( & self , tcx : TyCtxt < ' _ , ' _ , ' _ > ) {
163
170
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 ) ;
164
175
self . condvar . notify_one ( ) ;
165
176
}
166
177
}
@@ -200,6 +211,10 @@ impl QueryLatch {
200
211
// Spawn a thread to handle the deadlock before we go to sleep
201
212
handle_deadlock ( tcx) ;
202
213
}
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 ) ;
203
218
waiter. condvar . wait ( & mut info) ;
204
219
}
205
220
}
0 commit comments