Add ContextVerb with Stop and Unstop additionally.
This commit is contained in:
+19
@@ -178,8 +178,27 @@ pub enum ContextStatus {
|
||||
Blocked,
|
||||
NotYetStarted,
|
||||
Dead,
|
||||
Stopped,
|
||||
Other, // reserved
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[repr(usize)]
|
||||
pub enum ContextVerb {
|
||||
Stop = 1,
|
||||
Unstop = 2,
|
||||
ForceKill = usize::MAX,
|
||||
}
|
||||
impl ContextVerb {
|
||||
pub fn try_from_raw(raw: usize) -> Option<Self> {
|
||||
Some(match raw {
|
||||
1 => Self::Stop,
|
||||
usize::MAX => Self::ForceKill,
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// NOT ABI STABLE!
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[repr(u8)]
|
||||
|
||||
Reference in New Issue
Block a user