summaryrefslogtreecommitdiff
path: root/src/context/context.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-08-26 21:03:22 -0400
committerMica White <botahamec@outlook.com>2026-08-26 21:03:22 -0400
commit0a6bd8f2c0a7c79d17f5dc9e64af0b4c6c745166 (patch)
tree30f115f637422040ad64da73eb5edd0552ae4bee /src/context/context.rs
parent55b3a2425b242fbc5c6e471f220eeb8b949e8751 (diff)
Comments
Diffstat (limited to 'src/context/context.rs')
-rw-r--r--src/context/context.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/context/context.rs b/src/context/context.rs
index adc684f..80a1881 100644
--- a/src/context/context.rs
+++ b/src/context/context.rs
@@ -7,7 +7,9 @@ use crate::{
};
impl<'l, L> LockContext<'l, L> {
- pub(crate) const fn new(lockable: &'l L) -> Self
+ /// Safety: Don't lock the locks in a different order than what the
+ /// LockContext uses
+ pub(crate) const unsafe fn new(lockable: &'l L) -> Self
where
L: OwnedLockable,
{
@@ -56,6 +58,8 @@ impl<'l, L> LockContext<'l, L> {
/// ```
///
/// [`ContextGuard`]: `crate::context::ContextGuard`
+ // The mutable reference ensures that all of the guards, which have a shared
+ // borrow to the context, must be dropped first
pub fn unlock(&mut self) -> Option<ThreadKey> {
self.key.take()
}