summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-10 18:13:20 -0400
committerMica White <botahamec@outlook.com>2024-03-10 18:13:20 -0400
commit0c519b6c7801aa6a085551c8e144f0336e615870 (patch)
tree19063baecb0b50266c654f4809101e856ee89082 /src/lib.rs
parent61d709c211132adcc5158ded77c17d690ad5f8da (diff)
Better librarification
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 25b6d03..e99db7c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -5,17 +5,22 @@
#![allow(clippy::semicolon_if_nothing_returned)]
mod collection;
-mod key;
mod lockable;
+pub mod key;
pub mod mutex;
pub mod rwlock;
pub use collection::LockCollection;
-pub use key::{Key, ThreadKey};
pub use lockable::Lockable;
pub use mutex::SpinLock;
+/// The key for the current thread.
+///
+/// Only one of these exist per thread. To get the current thread's key, call
+/// [`ThreadKey::lock`]. If the `ThreadKey` is dropped, it can be reobtained.
+pub type ThreadKey = key::Key<'static>;
+
/// A mutual exclusion primitive useful for protecting shared data, which cannot deadlock.
///
/// By default, this uses `parking_lot` as a backend.