Skip to content

Commit 3cba120

Browse files
committed
std panicking: ALWAYS_ABORT: use Relaxed memory ordering
As per #81858 (comment) Suggested-by: Mara Bos <[email protected]> Signed-off-by: Ian Jackson <[email protected]>
1 parent 1b1bf24 commit 3cba120

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/panicking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pub mod panic_count {
259259

260260
pub fn increase() -> (bool, usize) {
261261
(
262-
GLOBAL_PANIC_COUNT.fetch_add(1, Ordering::Acquire) & ALWAYS_ABORT_FLAG != 0,
262+
GLOBAL_PANIC_COUNT.fetch_add(1, Ordering::Relaxed) & ALWAYS_ABORT_FLAG != 0,
263263
LOCAL_PANIC_COUNT.with(|c| {
264264
let next = c.get() + 1;
265265
c.set(next);
@@ -278,7 +278,7 @@ pub mod panic_count {
278278
}
279279

280280
pub fn set_always_abort() {
281-
GLOBAL_PANIC_COUNT.fetch_or(ALWAYS_ABORT_FLAG, Ordering::Release);
281+
GLOBAL_PANIC_COUNT.fetch_or(ALWAYS_ABORT_FLAG, Ordering::Relaxed);
282282
}
283283

284284
// Disregards ALWAYS_ABORT_FLAG

0 commit comments

Comments
 (0)