diff options
| author | Mica White <botahamec@outlook.com> | 2024-03-08 11:45:15 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2024-03-08 11:45:15 -0500 |
| commit | 6b4951ade670acbe3cb34b2002fbcd4b4e6a7300 (patch) | |
| tree | c800e9888ba649e2cff27cc1b8ae001c3632572d /src/lockable.rs | |
| parent | cff337867884fc5d9eff80c77d41e64ee53c6115 (diff) | |
Replace ownership with mutable access
Diffstat (limited to 'src/lockable.rs')
| -rw-r--r-- | src/lockable.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lockable.rs b/src/lockable.rs index 9b754a3..b6ba7d6 100644 --- a/src/lockable.rs +++ b/src/lockable.rs @@ -28,8 +28,8 @@ pub unsafe trait Lockable<'a>: sealed::Sealed { /// # Safety /// /// It is undefined behavior to: - /// * Use this without ownership of the [`ThreadKey`], which should last as - /// long as the return value is alive. + /// * 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. unsafe fn lock(&'a self) -> Self::Output; @@ -39,8 +39,9 @@ pub unsafe trait Lockable<'a>: sealed::Sealed { /// /// # Safety /// - /// It is undefined behavior to use this without ownership of the - /// [`ThreadKey`], which should last as long as the return value is alive. + /// 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. unsafe fn try_lock(&'a self) -> Option<Self::Output>; /// Release the lock |
