burritos/src/utility/system.rs

22 lines
473 B
Rust
Raw Normal View History

2023-03-01 11:10:15 +01:00
use std::sync::{Mutex, RwLock};
use lazy_static::lazy_static;
2023-03-01 10:11:19 +01:00
use crate::kernel::thread::Thread;
2023-03-01 11:10:15 +01:00
extern crate lazy_static;
2023-03-01 10:11:19 +01:00
2023-03-01 11:10:15 +01:00
lazy_static! {
pub static ref G_CURRENT_THREAD: RwLock<Option<Thread>> = RwLock::new(Option::None);
pub static ref G_THREAD_TO_BE_DESTROYED: RwLock<Option<Thread>> = RwLock::new(Option::None);
2023-03-01 11:10:15 +01:00
}
2023-03-01 10:11:19 +01:00
2023-02-28 14:43:40 +01:00
2023-03-01 11:10:15 +01:00
#[derive(PartialEq)]
2023-02-28 14:43:40 +01:00
pub enum ObjectType {
SemaphoreType,
LockType,
ConditionType,
FileType,
ThreadType,
InvalidType
2023-02-28 14:43:40 +01:00
}