improve deadlock panic message
This commit is contained in:
parent
a8d2f3fe62
commit
ac77b691df
@ -97,16 +97,17 @@ fn main() -> anyhow::Result<()> {
|
||||
continue;
|
||||
}
|
||||
|
||||
println!("{} deadlocks detected", deadlocks.len());
|
||||
let mut msg = format!("{} deadlocks detected\n", deadlocks.len());
|
||||
|
||||
for (i, threads) in deadlocks.iter().enumerate() {
|
||||
println!("Deadlock #{}", i);
|
||||
msg += &format!("Deadlock #{}", i);
|
||||
for t in threads {
|
||||
println!("Thread Id {:#?}", t.thread_id());
|
||||
println!("{:#?}", t.backtrace());
|
||||
msg += &format!("Thread Id {:#?}\n", t.thread_id());
|
||||
msg += &format!("{:#?}\n", t.backtrace());
|
||||
}
|
||||
}
|
||||
|
||||
panic!("deadlock detected!");
|
||||
panic!("{:#}", msg);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user