From 03d0cdb7145042ce51c9eb98bfd081a4f10fe8e1 Mon Sep 17 00:00:00 2001 From: Mica White Date: Fri, 8 Mar 2024 12:18:41 -0500 Subject: Keyable --- src/lockable.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lockable.rs') diff --git a/src/lockable.rs b/src/lockable.rs index b6ba7d6..cda4e13 100644 --- a/src/lockable.rs +++ b/src/lockable.rs @@ -31,6 +31,8 @@ pub unsafe trait Lockable<'a>: sealed::Sealed { /// * Use this without ownership or mutable access to the [`ThreadKey`], /// which should last as long as the return value is alive. /// * Call this on multiple locks without unlocking first. + /// + /// [`ThreadKey`]: `crate::key::ThreadKey` unsafe fn lock(&'a self) -> Self::Output; /// Attempt to lock without blocking. @@ -42,6 +44,8 @@ pub unsafe trait Lockable<'a>: sealed::Sealed { /// It is undefined behavior to use this without ownership or mutable /// access to the [`ThreadKey`], which should last as long as the return /// value is alive. + /// + /// [`ThreadKey`]: `crate::key::ThreadKey` unsafe fn try_lock(&'a self) -> Option; /// Release the lock -- cgit v1.2.3