Fix global var

This commit is contained in:
Quentin Legot
2023-03-01 11:10:15 +01:00
committed by François Autin
parent e3e217c57f
commit cf1c7aad5a
6 changed files with 49 additions and 19 deletions

View File

@ -1,9 +1,17 @@
use std::sync::{Mutex, RwLock};
use lazy_static::lazy_static;
use crate::kernel::thread::Thread;
extern crate lazy_static;
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);
}
pub static g_current_thread: Box<Option<Thread>> = Box::new(Option::None);
pub static g_thread_to_be_destroyed: Box<Option<Thread>> = Box::new(Option::None);
#[derive(PartialEq)]
pub enum ObjectType {
SEMAPHORE_TYPE,
LOCK_TYPE,