Skip to content

Commit

Permalink
fix(register-blazemap-id): atomic ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsonin committed Apr 17, 2024
1 parent 9bf8865 commit 039adc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/static_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ impl TrivialIdStaticInfo
#[inline]
pub fn next_id(&self) -> usize {
self.next_id.fetch_update(
Ordering::Relaxed,
Ordering::Relaxed,
Ordering::Release,
Ordering::Acquire,
|next_id| next_id.checked_add(1),
)
.expect("usize overflow")
Expand Down Expand Up @@ -105,7 +105,7 @@ impl StaticInfoApi<usize> for TrivialIdStaticInfo

#[inline(always)]
fn num_elems(&self) -> usize {
self.next_id.load(Ordering::Relaxed)
self.next_id.load(Ordering::Acquire)
}

#[inline(always)]
Expand Down

0 comments on commit 039adc1

Please sign in to comment.