@@ -38,7 +38,7 @@ pub struct QueryInfo {
38
38
pub type QueryMap = FxHashMap < QueryJobId , QueryJobInfo > ;
39
39
40
40
/// A value uniquely identifying an active query job.
41
- #[ derive( Copy , Clone , Eq , PartialEq , Hash ) ]
41
+ #[ derive( Copy , Clone , Eq , PartialEq , Hash , Debug ) ]
42
42
pub struct QueryJobId ( pub NonZeroU64 ) ;
43
43
44
44
impl QueryJobId {
@@ -62,14 +62,14 @@ impl QueryJobId {
62
62
}
63
63
}
64
64
65
- #[ derive( Clone ) ]
65
+ #[ derive( Clone , Debug ) ]
66
66
pub struct QueryJobInfo {
67
67
pub query : QueryStackFrame ,
68
68
pub job : QueryJob ,
69
69
}
70
70
71
71
/// Represents an active query job.
72
- #[ derive( Clone ) ]
72
+ #[ derive( Clone , Debug ) ]
73
73
pub struct QueryJob {
74
74
pub id : QueryJobId ,
75
75
@@ -182,6 +182,7 @@ impl QueryJobId {
182
182
}
183
183
184
184
#[ cfg( parallel_compiler) ]
185
+ #[ derive( Debug ) ]
185
186
struct QueryWaiter {
186
187
query : Option < QueryJobId > ,
187
188
condvar : Condvar ,
@@ -198,13 +199,14 @@ impl QueryWaiter {
198
199
}
199
200
200
201
#[ cfg( parallel_compiler) ]
202
+ #[ derive( Debug ) ]
201
203
struct QueryLatchInfo {
202
204
complete : bool ,
203
205
waiters : Vec < Arc < QueryWaiter > > ,
204
206
}
205
207
206
208
#[ cfg( parallel_compiler) ]
207
- #[ derive( Clone ) ]
209
+ #[ derive( Clone , Debug ) ]
208
210
pub ( super ) struct QueryLatch {
209
211
info : Arc < Mutex < QueryLatchInfo > > ,
210
212
}
@@ -540,7 +542,11 @@ pub fn deadlock(query_map: QueryMap, registry: &rayon_core::Registry) {
540
542
// X to Y due to Rayon waiting and a true dependency from Y to X. The algorithm here
541
543
// only considers the true dependency and won't detect a cycle.
542
544
if !found_cycle {
543
- panic ! ( "deadlock detected" ) ;
545
+ if query_map. len ( ) == 0 {
546
+ panic ! ( "deadlock detected without any query!" )
547
+ } else {
548
+ panic ! ( "deadlock detected! current query map:\n {:?}" , query_map) ;
549
+ }
544
550
}
545
551
546
552
// FIXME: Ensure this won't cause a deadlock before we return
0 commit comments