Skip to content

Commit

Permalink
Improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn committed Nov 5, 2023
1 parent bc9f073 commit b6cc055
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion polkadot/node/tracking-allocator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ impl<T> Spinlock<T> {
}

// SAFETY: It should be only called from the guard's destructor. Calling it explicitly while
// the guard is alive is undefined behavior.
// the guard is alive is undefined behavior, as it breaks the security contract of `Deref` and
// `DerefMut`, which implies that lock is held at the moment of dereferencing.
#[inline]
unsafe fn unlock(&self) {
self.lock.store(false, Ordering::Release);
Expand Down

0 comments on commit b6cc055

Please sign in to comment.