fix(rp2): switch spinlock busy loop to wfe

This commit is contained in:
Michael Smith
2025-09-16 17:49:39 -04:00
committed by Ron Evans
parent 5d8afa25b8
commit 3dce224183
+2 -4
View File
@@ -311,15 +311,13 @@ func (l *spinLock) Lock() {
// Wait for the lock to be available.
spinlock := l.spinlock()
for spinlock.Get() == 0 {
// TODO: use wfe and send an event when unlocking so the CPU can go to
// sleep while waiting for the lock.
// Unfortunately when doing that, time.Sleep() seems to hang somewhere.
// This needs some debugging to figure out.
arm.Asm("wfe")
}
}
func (l *spinLock) Unlock() {
l.spinlock().Set(0)
arm.Asm("sev")
}
// Wait until a signal is received, indicating that it can resume from the