Skip to content

Commit

Permalink
Merge pull request #1 from Foundation-Devices/1.66.0-xous-arm-rebase
Browse files Browse the repository at this point in the history
1.66.0 xous arm rebase
  • Loading branch information
eupn authored Feb 16, 2023
2 parents 83543c7 + 20890db commit 440c96e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions library/std/src/sys/xous/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,13 @@ mod lock {
if LOCKED.swap(1, SeqCst) == 0 {
return DropLock;
}
xous::syscall::yield_slice();
}
}

impl Drop for DropLock {
fn drop(&mut self) {
let r = LOCKED.swap(0, SeqCst);
debug_assert_eq!(r, 1);
// this yield_slice() will allow any waiting thread to wake up and
// do its thing -- without it, a waiting thread could be starved if
// the code continues executing and within the same quanta it grabs
// the lock again.
xous::syscall::yield_slice();
}
}
}

0 comments on commit 440c96e

Please sign in to comment.