diff options
| author | Botahamec <botahamec@outlook.com> | 2022-11-18 23:08:25 -0500 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2022-11-18 23:08:25 -0500 |
| commit | d96edbd12da892a101362ae89fb3c10917361fe6 (patch) | |
| tree | 7dd5878edd4f706baa81606ec4bf19bda353ec90 /src | |
| parent | 838d37e84340259d8ce1313a6985e688c77fb770 (diff) | |
Reorganized modules
Diffstat (limited to 'src')
| -rw-r--r-- | src/guard.rs | 4 | ||||
| -rw-r--r-- | src/lib.rs | 6 | ||||
| -rw-r--r-- | src/mutex.rs | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/guard.rs b/src/guard.rs index ec7020b..5ac11e9 100644 --- a/src/guard.rs +++ b/src/guard.rs @@ -1,8 +1,8 @@ use std::ops::{Deref, DerefMut}; use crate::{ - mutex::{MutexRef, RawMutex}, - Mutex, ThreadKey, + mutex::{Mutex, MutexRef, RawMutex}, + ThreadKey, }; mod sealed { @@ -12,15 +12,11 @@ use thread_local::ThreadLocal; mod guard; mod lock; -mod mutex; +pub mod mutex; use lock::{Key, Lock}; -use mutex::RawSpin; pub use guard::{LockGuard, Lockable}; -pub use mutex::{Mutex, MutexGuard}; -/// A spinning mutex -pub type SpinLock<T> = Mutex<RawSpin, T>; static KEY: Lazy<ThreadLocal<Lock>> = Lazy::new(ThreadLocal::new); diff --git a/src/mutex.rs b/src/mutex.rs index 9231f65..aa7ec72 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -4,6 +4,9 @@ use std::ops::{Deref, DerefMut}; use crate::lock::Lock; use crate::ThreadKey; +/// A spinning mutex +pub type SpinLock<T> = Mutex<RawSpin, T>; + /// Implements a raw C-like mutex. /// /// # Safety |
