We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
yield_cpu
1 parent 89c3816 commit 70677bbCopy full SHA for 70677bb
src/r3_port_arm_m/src/threading/imp.rs
@@ -169,12 +169,18 @@ impl State {
169
}
170
171
pub unsafe fn yield_cpu<Traits: PortInstance>(&'static self) {
172
+ // Ensure preceding memory operations are visible to the PendSV handler
173
+ compiler_fence(Ordering::Release);
174
+
175
// Safety: See `use_port!`
176
cortex_m::peripheral::SCB::set_pendsv();
177
178
// Technically this DSB isn't required for correctness, but ensures
179
// PendSV is taken before the next operation.
180
cortex_m::asm::dsb();
181
182
+ // Ensure the PendSV handler's memory operations are visible to us
183
+ compiler_fence(Ordering::Acquire);
184
185
186
pub unsafe fn exit_and_dispatch<Traits: PortInstance>(
0 commit comments