Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ where
}

/// Returns true, if the Reader counterpart was dropped.
pub fn is_abandoned(&mut self) -> bool {
std::sync::Arc::get_mut(&mut self.mem).is_some()
pub fn is_abandoned(&self) -> bool {
std::sync::Arc::strong_count(&self.mem) < 2
}

/// Write and commit a single element, or return it if the queue was full.
Expand Down Expand Up @@ -440,8 +440,8 @@ where
}

/// Returns true, if the Writer counterpart was dropped.
pub fn is_abandoned(&mut self) -> bool {
std::sync::Arc::get_mut(&mut self.mem).is_some()
pub fn is_abandoned(&self) -> bool {
std::sync::Arc::strong_count(&self.mem) < 2
}

#[inline]
Expand Down