aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src/arch/riscv32.rs
diff options
context:
space:
mode:
authorSijmen Woutersen <[email protected]>2022-11-12 10:56:49 +0100
committerSijmen Woutersen <[email protected]>2022-11-12 10:58:37 +0100
commite70ae71eccf370c42043fa323002c14f94a16679 (patch)
treeb1854ae62024936120394b6ed24ad1769e15f17c /embassy-executor/src/arch/riscv32.rs
parent6e1120e17e384a04cd3aef58a1467a4a0a862ba5 (diff)
restore SIGNAL_WORK_THREAD_MODE
Diffstat (limited to 'embassy-executor/src/arch/riscv32.rs')
-rw-r--r--embassy-executor/src/arch/riscv32.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/embassy-executor/src/arch/riscv32.rs b/embassy-executor/src/arch/riscv32.rs
index e095c0ee0..76eb8b114 100644
--- a/embassy-executor/src/arch/riscv32.rs
+++ b/embassy-executor/src/arch/riscv32.rs
@@ -54,7 +54,12 @@ impl Executor {
54 loop { 54 loop {
55 unsafe { 55 unsafe {
56 self.inner.poll(); 56 self.inner.poll();
57 core::arch::asm!("wfi"); 57 // we do not care about race conditions between the load and store operations, interrupts
58 // will only set this value to true.
59 // if there is work to do, loop back to polling
60 if !SIGNAL_WORK_THREAD_MODE.fetch_and(false, Ordering::SeqCst) {
61 core::arch::asm!("wfi");
62 }
58 } 63 }
59 } 64 }
60 } 65 }