Skip to content

Commit

Permalink
Gate ShardedList::added by 64-bit atomics
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Jun 17, 2024
1 parent 56c56fd commit f82c95f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tokio/src/util/sharded_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ impl<L: ShardedListItem> ShardedList<L, L::Target> {
self.count.load(Ordering::Relaxed)
}

/// Gets the total number of elements added to this list.
pub(crate) fn added(&self) -> u64 {
self.added.load(Ordering::Relaxed)
cfg_64bit_metrics! {
/// Gets the total number of elements added to this list.
pub(crate) fn added(&self) -> u64 {
self.added.load(Ordering::Relaxed)
}
}

/// Returns whether the linked list does not contain any node.
Expand Down

0 comments on commit f82c95f

Please sign in to comment.