Use status helpers
This commit is contained in:
+1
-1
@@ -1240,7 +1240,7 @@ impl ContextHandle {
|
||||
} else {
|
||||
let mut ctxt = context.write(token.token());
|
||||
//trace!("FORCEKILL NONSELF={} {}, SELF={}", ctxt.debug_id, ctxt.pid, context::current().read().debug_id);
|
||||
if let context::Status::Dead { .. } = ctxt.status {
|
||||
if ctxt.status.is_dead() {
|
||||
return Ok(size_of::<usize>());
|
||||
}
|
||||
ctxt.status = context::Status::Runnable;
|
||||
|
||||
@@ -86,9 +86,9 @@ fn get_contexts_stats(token: &mut CleanLockToken) -> (u64, u64) {
|
||||
};
|
||||
|
||||
for status in statuses {
|
||||
if matches!(status, Status::Runnable) {
|
||||
if status.is_runnable() {
|
||||
running += 1;
|
||||
} else if !matches!(status, Status::Dead { .. }) {
|
||||
} else if !status.is_dead() {
|
||||
blocked += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user