Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion crates/neon/src/lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl InstanceId {
fn next() -> Self {
static NEXT_ID: AtomicU32 = AtomicU32::new(0);

let next = NEXT_ID.fetch_add(1, Ordering::SeqCst).checked_add(1);
let next = NEXT_ID.fetch_add(1, Ordering::Relaxed).checked_add(1);
match next {
Some(id) => Self(id),
None => panic!("u32 overflow ocurred in Lifecycle InstanceId"),
Expand Down
2 changes: 1 addition & 1 deletion crates/neon/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ use crate::lifecycle::LocalCell;
static COUNTER: AtomicUsize = AtomicUsize::new(0);

fn next_id() -> usize {
COUNTER.fetch_add(1, Ordering::SeqCst)
COUNTER.fetch_add(1, Ordering::Relaxed)
}

/// A JavaScript thread-local container that owns its contents, similar to
Expand Down