Print the thread name in Debug.
This commit is contained in:
parent
3bb1657448
commit
452e36efb3
@ -131,7 +131,16 @@ impl<'mir, 'tcx> Thread<'mir, 'tcx> {
|
||||
|
||||
impl<'mir, 'tcx> std::fmt::Debug for Thread<'mir, 'tcx> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{:?}", self.state)
|
||||
if let Some(ref name) = self.thread_name {
|
||||
if let Ok(name_str) = std::str::from_utf8(name) {
|
||||
write!(f, "{}", name_str)?;
|
||||
} else {
|
||||
write!(f, "<invalid thread name>")?;
|
||||
}
|
||||
} else {
|
||||
write!(f, "unnamed")?;
|
||||
}
|
||||
write!(f, "({:?}, {:?})", self.state, self.join_status)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user