mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 09:23:25 +00:00
Remove the shim kernel crate
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d76c7a5b1e
commit
dafd16075f
35
kernel/src/process/status.rs
Normal file
35
kernel/src/process/status.rs
Normal file
@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
//! The process status
|
||||
|
||||
use super::TermStatus;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum ProcessStatus {
|
||||
// Not ready to run
|
||||
Uninit,
|
||||
/// Can be scheduled to run
|
||||
Runnable,
|
||||
/// Exit while not reaped by parent
|
||||
Zombie(TermStatus),
|
||||
}
|
||||
|
||||
impl ProcessStatus {
|
||||
pub fn set_zombie(&mut self, term_status: TermStatus) {
|
||||
*self = ProcessStatus::Zombie(term_status);
|
||||
}
|
||||
|
||||
pub fn is_zombie(&self) -> bool {
|
||||
matches!(self, ProcessStatus::Zombie(_))
|
||||
}
|
||||
|
||||
pub fn set_runnable(&mut self) {
|
||||
*self = ProcessStatus::Runnable;
|
||||
}
|
||||
|
||||
pub fn is_runnable(&self) -> bool {
|
||||
*self == ProcessStatus::Runnable
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user