2023-03-01 15:45:49 +01:00
|
|
|
use std::sync::{RwLock, Arc};
|
2023-03-01 11:10:15 +01:00
|
|
|
|
|
|
|
use lazy_static::lazy_static;
|
|
|
|
|
2023-03-01 10:11:19 +01:00
|
|
|
use crate::kernel::thread::Thread;
|
2023-03-01 15:45:49 +01:00
|
|
|
|
|
|
|
use super::list::List;
|
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! {
|
2023-03-01 11:16:21 +01:00
|
|
|
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 15:45:49 +01:00
|
|
|
// pub static ref G_ALIVE: Arc<RwLock<List<Thread>>> = Arc::new(RwLock::new(List::new()));
|
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 {
|
2023-03-01 11:16:21 +01:00
|
|
|
SemaphoreType,
|
|
|
|
LockType,
|
|
|
|
ConditionType,
|
|
|
|
FileType,
|
|
|
|
ThreadType,
|
|
|
|
InvalidType
|
2023-02-28 14:43:40 +01:00
|
|
|
}
|