Add ContextStatus::HardBlocked.
This commit is contained in:
@@ -35,10 +35,27 @@ int_like!(ContextId, AtomicContextId, usize, AtomicUsize);
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Status {
|
||||
Runnable,
|
||||
|
||||
// TODO: Rename to SoftBlocked and move status_reason to this variant.
|
||||
|
||||
/// Not currently runnable, typically due to some blocking syscall, but it can be trivially
|
||||
/// unblocked by e.g. signals.
|
||||
Blocked,
|
||||
|
||||
/// Not currently runnable, and cannot be runnable until manually unblocked, depending on what
|
||||
/// reason.
|
||||
HardBlocked { reason: HardBlockedReason },
|
||||
|
||||
Stopped(usize),
|
||||
Exited(usize),
|
||||
}
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum HardBlockedReason {
|
||||
AwaitingMmap,
|
||||
// TODO: PageFaultOom?
|
||||
// TODO: NotYetStarted/ManuallyBlocked (when new contexts are created)
|
||||
// TODO: ptrace_stop?
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct WaitpidKey {
|
||||
|
||||
@@ -43,7 +43,7 @@ pub fn resource() -> Result<Vec<u8>> {
|
||||
context::Status::Runnable => {
|
||||
stat_string.push('R');
|
||||
},
|
||||
context::Status::Blocked => if context.wake.is_some() {
|
||||
context::Status::Blocked | context::Status::HardBlocked { .. } => if context.wake.is_some() {
|
||||
stat_string.push('S');
|
||||
} else {
|
||||
stat_string.push('B');
|
||||
|
||||
Reference in New Issue
Block a user