Skip to content

Commit

Permalink
Add a sentence about ordering guarantees to doc comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
jannic committed Sep 14, 2022
1 parent 09399f6 commit a26ec72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ impl RestoreState {
/// - `acquire`/`release` pairs must be "properly nested", ie it's not OK to do `a=acquire(); b=acquire(); release(a); release(b);`.
/// - It is UB to call `release` if the critical section is not acquired in the current thread.
/// - It is UB to call `release` with a "restore state" that does not come from the corresponding `acquire` call.
/// - It must provide ordering guarantees at least equivalent to a [`core::sync::atomic::Ordering::Acquire`]
/// on a memory location shared by all critical sections, on which the `release` call will do a
/// [`core::sync::atomic::Ordering::Release`] operation.
#[inline(always)]
pub unsafe fn acquire() -> RestoreState {
extern "Rust" {
Expand Down

0 comments on commit a26ec72

Please sign in to comment.