Use a SpinLock for the thread table instead of Mutex

This commit is contained in:
Zhang Junyang 2024-08-26 17:00:22 +08:00 committed by Tate, Hongliang Tian
parent aeba7bec52
commit ed82c11dd3

View File

@ -4,7 +4,7 @@ use super::{Thread, Tid};
use crate::prelude::*;
lazy_static! {
static ref THREAD_TABLE: Mutex<BTreeMap<Tid, Arc<Thread>>> = Mutex::new(BTreeMap::new());
static ref THREAD_TABLE: SpinLock<BTreeMap<Tid, Arc<Thread>>> = SpinLock::new(BTreeMap::new());
}
pub fn add_thread(thread: Arc<Thread>) {