Skip to content

Commit

Permalink
Merge pull request #25 from xnxkzeu/patch-1
Browse files Browse the repository at this point in the history
Relaxed memory ordering is enough for atomic counter
  • Loading branch information
icewind1991 authored Oct 29, 2024
2 parents 935bfde + 8eb952a commit ff8ea77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub struct JobIdCounter(Arc<AtomicU64>);
impl JobIdCounter {
#[allow(clippy::should_implement_trait)]
pub fn next(&self) -> JobId {
JobId(self.0.fetch_add(1, Ordering::SeqCst))
JobId(self.0.fetch_add(1, Ordering::Relaxed))
}
}

Expand Down

0 comments on commit ff8ea77

Please sign in to comment.