File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
library/std/src/sys/pal/xous Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,18 @@ unsafe impl GlobalAlloc for System {
4646}
4747
4848mod lock {
49- use crate :: sync:: atomic:: { AtomicI32 , Ordering :: SeqCst } ;
49+ use crate :: sync:: atomic:: {
50+ AtomicI32 ,
51+ Ordering :: { Acquire , Release } ,
52+ } ;
5053
5154 static LOCKED : AtomicI32 = AtomicI32 :: new ( 0 ) ;
5255
5356 pub struct DropLock ;
5457
5558 pub fn lock ( ) -> DropLock {
5659 loop {
57- if LOCKED . swap ( 1 , SeqCst ) == 0 {
60+ if LOCKED . swap ( 1 , Acquire ) == 0 {
5861 return DropLock ;
5962 }
6063 crate :: os:: xous:: ffi:: do_yield ( ) ;
@@ -63,7 +66,7 @@ mod lock {
6366
6467 impl Drop for DropLock {
6568 fn drop ( & mut self ) {
66- let r = LOCKED . swap ( 0 , SeqCst ) ;
69+ let r = LOCKED . swap ( 0 , Release ) ;
6770 debug_assert_eq ! ( r, 1 ) ;
6871 }
6972 }
You can’t perform that action at this time.
0 commit comments