Skip to content

Commit 549e951

Browse files
authored
Merge pull request #516 from jamesmunns/patch-1
Update critical_section.rs
2 parents 335c8c2 + f434bf6 commit 549e951

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: cortex-m/src/critical_section.rs

+3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ set_impl!(SingleCoreCriticalSection);
99
unsafe impl Impl for SingleCoreCriticalSection {
1010
unsafe fn acquire() -> RawRestoreState {
1111
let was_active = primask::read().is_active();
12+
// NOTE: Fence guarantees are provided by interrupt::disable(), which performs a `compiler_fence(SeqCst)`.
1213
interrupt::disable();
1314
was_active
1415
}
1516

1617
unsafe fn release(was_active: RawRestoreState) {
1718
// Only re-enable interrupts if they were enabled before the critical section.
1819
if was_active {
20+
// NOTE: Fence guarantees are provided by interrupt::enable(), which performs a
21+
// `compiler_fence(SeqCst)`.
1922
interrupt::enable()
2023
}
2124
}

0 commit comments

Comments
 (0)