Skip to content

Commit

Permalink
Add fence to is_abandoned() docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed May 25, 2024
1 parent 4865c87 commit abe330f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ impl<T> Producer<T> {
/// # use rtrb::RingBuffer;
/// # let (p, c) = RingBuffer::<i32>::new(1);
/// if p.is_abandoned() {
/// // This is needed since Rust 1.74.0, see https:/mgeier/rtrb/issues/114:
/// std::sync::atomic::fence(std::sync::atomic::Ordering::Acquire);
/// // The consumer does definitely not exist anymore.
/// }
/// ```
Expand Down Expand Up @@ -669,6 +671,8 @@ impl<T> Consumer<T> {
/// # use rtrb::RingBuffer;
/// # let (p, c) = RingBuffer::<i32>::new(1);
/// if c.is_abandoned() {
/// // This is needed since Rust 1.74.0, see https:/mgeier/rtrb/issues/114:
/// std::sync::atomic::fence(std::sync::atomic::Ordering::Acquire);
/// // The producer does definitely not exist anymore.
/// }
/// ```
Expand Down

0 comments on commit abe330f

Please sign in to comment.