From 0b49b056981f4c5bcbdbb7fada1a8379e0793c86 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Fri, 28 Oct 2022 22:20:05 -0400 Subject: Implemented SpinLock --- src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 615086d..2358ba2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ #![warn(clippy::pedantic)] #![warn(clippy::nursery)] #![allow(clippy::module_name_repetitions)] +#![allow(clippy::declare_interior_mutable_const)] use std::any::type_name; use std::fmt::{self, Debug}; @@ -10,11 +11,13 @@ use once_cell::sync::Lazy; use thread_local::ThreadLocal; mod lock; -pub mod mutex; +mod mutex; use lock::{Key, Lock}; +use mutex::RawSpin; -pub use mutex::Mutex; +pub use mutex::{Mutex, MutexGuard}; +pub type SpinLock = Mutex; static KEY: Lazy> = Lazy::new(ThreadLocal::new); -- cgit v1.2.3