Skip to content

Commit

Permalink
Merge pull request #212 from dtolnay/relaxed
Browse files Browse the repository at this point in the history
Change Backtrace::enabled atomic from SeqCst to Relaxed
  • Loading branch information
dtolnay committed Dec 23, 2021
2 parents a3f7160 + 6b3630c commit 6e17bdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backtrace.rs
Expand Up @@ -182,7 +182,7 @@ mod capture {
impl Backtrace {
fn enabled() -> bool {
static ENABLED: AtomicUsize = AtomicUsize::new(0);
match ENABLED.load(Ordering::SeqCst) {
match ENABLED.load(Ordering::Relaxed) {
0 => {}
1 => return false,
_ => return true,
Expand All @@ -194,7 +194,7 @@ mod capture {
None => false,
},
};
ENABLED.store(enabled as usize + 1, Ordering::SeqCst);
ENABLED.store(enabled as usize + 1, Ordering::Relaxed);
enabled
}

Expand Down

0 comments on commit 6e17bdb

Please sign in to comment.