burritos/src/utility/system.rs

22 lines
479 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 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 {
SEMAPHORE_TYPE,
LOCK_TYPE,
CONDITION_TYPE,
FILE_TYPE,
THREAD_TYPE,
INVALID_TYPE
}