@@ -167,13 +167,13 @@ struct QueryWaiter<'a, 'tcx: 'a> {
167
167
168
168
#[ cfg( parallel_queries) ]
169
169
impl < ' a , ' tcx > QueryWaiter < ' a , ' tcx > {
170
- fn notify ( & self , tcx : TyCtxt < ' _ , ' _ , ' _ > ) {
170
+ fn notify ( & self , tcx : TyCtxt < ' _ , ' _ , ' _ > , registry : & rayon_core :: Registry ) {
171
171
tcx. active_threads . fetch_add ( 1 , Ordering :: SeqCst ) ;
172
172
eprintln ! ( "[{:?}] (wake) active threads: {} condvar: {:x}" ,
173
173
:: std:: thread:: current( ) . id( ) ,
174
174
tcx. active_threads. load( Ordering :: SeqCst ) ,
175
175
& self . condvar as * const _ as usize ) ;
176
- rayon_core:: unblock ( ) ;
176
+ rayon_core:: unblock ( registry ) ;
177
177
self . condvar . notify_one ( ) ;
178
178
}
179
179
}
@@ -228,8 +228,9 @@ impl QueryLatch {
228
228
let mut info = self . info . lock ( ) ;
229
229
debug_assert ! ( !info. complete) ;
230
230
info. complete = true ;
231
+ let registry = rayon_core:: Registry :: current ( ) ;
231
232
for waiter in info. waiters . drain ( ..) {
232
- waiter. notify ( tcx) ;
233
+ waiter. notify ( tcx, & registry ) ;
233
234
}
234
235
}
235
236
@@ -451,6 +452,8 @@ pub fn handle_deadlock() {
451
452
use syntax;
452
453
use syntax_pos;
453
454
455
+ let registry = rayon_core:: Registry :: current ( ) ;
456
+
454
457
let gcx_ptr = tls:: GCX_PTR . with ( |gcx_ptr| {
455
458
gcx_ptr as * const _
456
459
} ) ;
@@ -471,7 +474,7 @@ pub fn handle_deadlock() {
471
474
syntax_pos:: GLOBALS . set ( syntax_pos_globals, || {
472
475
tls:: with_thread_locals ( || {
473
476
unsafe {
474
- tls:: with_global ( |tcx| deadlock ( tcx) )
477
+ tls:: with_global ( |tcx| deadlock ( tcx, & registry ) )
475
478
}
476
479
} )
477
480
} )
@@ -481,7 +484,7 @@ pub fn handle_deadlock() {
481
484
}
482
485
483
486
#[ cfg( parallel_queries) ]
484
- fn deadlock ( tcx : TyCtxt < ' _ , ' _ , ' _ > ) {
487
+ fn deadlock ( tcx : TyCtxt < ' _ , ' _ , ' _ > , registry : & rayon_core :: Registry ) {
485
488
let on_panic = OnDrop ( || {
486
489
eprintln ! ( "deadlock handler panicked, aborting process" ) ;
487
490
process:: abort ( ) ;
@@ -514,7 +517,7 @@ fn deadlock(tcx: TyCtxt<'_, '_, '_>) {
514
517
515
518
// FIXME: Ensure this won't cause a deadlock before we return
516
519
for waiter in wakelist. into_iter ( ) {
517
- waiter. notify ( tcx) ;
520
+ waiter. notify ( tcx, registry ) ;
518
521
}
519
522
520
523
//eprintln!("aborting due to deadlock");
0 commit comments