Add exit status to status enum

This commit is contained in:
Jeremy Soller 2016-09-17 09:23:36 -06:00
parent da9e703c4d
commit dfbcca99dd
3 changed files with 13 additions and 6 deletions

View file

@ -11,7 +11,7 @@ use super::memory::{Memory, SharedMemory};
pub enum Status {
Runnable,
Blocked,
Exited
Exited(usize)
}
/// A context, which identifies either a process or a thread

View file

@ -57,3 +57,7 @@ pub fn contexts() -> RwLockReadGuard<'static, ContextList> {
pub fn contexts_mut() -> RwLockWriteGuard<'static, ContextList> {
CONTEXTS.call_once(init_contexts).write()
}
pub fn context_id() -> usize {
CONTEXT_ID.load(Ordering::SeqCst)
}