mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
std panicking: ALWAYS_ABORT: use Relaxed memory ordering
As per https://github.com/rust-lang/rust/pull/81858#discussion_r626507810 Suggested-by: Mara Bos <m-ou.se@m-ou.se> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
parent
1b1bf24636
commit
3cba120ba4
@ -259,7 +259,7 @@ pub mod panic_count {
|
||||
|
||||
pub fn increase() -> (bool, usize) {
|
||||
(
|
||||
GLOBAL_PANIC_COUNT.fetch_add(1, Ordering::Acquire) & ALWAYS_ABORT_FLAG != 0,
|
||||
GLOBAL_PANIC_COUNT.fetch_add(1, Ordering::Relaxed) & ALWAYS_ABORT_FLAG != 0,
|
||||
LOCAL_PANIC_COUNT.with(|c| {
|
||||
let next = c.get() + 1;
|
||||
c.set(next);
|
||||
@ -278,7 +278,7 @@ pub mod panic_count {
|
||||
}
|
||||
|
||||
pub fn set_always_abort() {
|
||||
GLOBAL_PANIC_COUNT.fetch_or(ALWAYS_ABORT_FLAG, Ordering::Release);
|
||||
GLOBAL_PANIC_COUNT.fetch_or(ALWAYS_ABORT_FLAG, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
// Disregards ALWAYS_ABORT_FLAG
|
||||
|
Loading…
Reference in New Issue
Block a user