mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 05:23:40 +00:00
runtime: make channels work in interrupts
This commit is contained in:
@@ -90,3 +90,11 @@ func procPin() {
|
||||
func procUnpin() {
|
||||
riscv.EnableInterrupts(procPinnedMask)
|
||||
}
|
||||
|
||||
func waitForEvents() {
|
||||
mask := riscv.DisableInterrupts()
|
||||
if !runqueue.Empty() {
|
||||
riscv.Asm("wfi")
|
||||
}
|
||||
riscv.EnableInterrupts(mask)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user