File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
library/std/src/sys/pal/wasm Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,15 +57,18 @@ unsafe impl GlobalAlloc for System {
5757
5858#[ cfg( target_feature = "atomics" ) ]
5959mod lock {
60- use crate :: sync:: atomic:: { AtomicI32 , Ordering :: SeqCst } ;
60+ use crate :: sync:: atomic:: {
61+ AtomicI32 ,
62+ Ordering :: { Acquire , Release } ,
63+ } ;
6164
6265 static LOCKED : AtomicI32 = AtomicI32 :: new ( 0 ) ;
6366
6467 pub struct DropLock ;
6568
6669 pub fn lock ( ) -> DropLock {
6770 loop {
68- if LOCKED . swap ( 1 , SeqCst ) == 0 {
71+ if LOCKED . swap ( 1 , Acquire ) == 0 {
6972 return DropLock ;
7073 }
7174 // Ok so here's where things get a little depressing. At this point
@@ -143,7 +146,7 @@ mod lock {
143146
144147 impl Drop for DropLock {
145148 fn drop ( & mut self ) {
146- let r = LOCKED . swap ( 0 , SeqCst ) ;
149+ let r = LOCKED . swap ( 0 , Release ) ;
147150 debug_assert_eq ! ( r, 1 ) ;
148151
149152 // Note that due to the above logic we don't actually need to wake
You can’t perform that action at this time.
0 commit comments