Skip to content

Commit

Permalink
Mitigate MIRI violation
Browse files Browse the repository at this point in the history
  • Loading branch information
Catamantaloedis authored Apr 12, 2024
1 parent 6325940 commit 3f1d7ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ unsafe impl crate::Impl for StdCriticalSection {
// SAFETY: As per the acquire/release safety contract, release can only be called
// if the critical section is acquired in the current thread,
// in which case we know the GLOBAL_GUARD is initialized.
GLOBAL_GUARD.assume_init_drop();
#[allow(let_underscore_lock)]
let _ = GLOBAL_GUARD.assume_init_read();

// Note: it is fine to clear this flag *after* releasing the mutex because it's thread local.
// No other thread can see its value, there's no potential for races.
Expand Down

0 comments on commit 3f1d7ac

Please sign in to comment.