diff --git a/src/crystal/spin_lock.cr b/src/crystal/spin_lock.cr index f0b4b2df4ab6..e3136cdf3fe9 100644 --- a/src/crystal/spin_lock.cr +++ b/src/crystal/spin_lock.cr @@ -11,11 +11,17 @@ class Crystal::SpinLock Intrinsics.pause end end + {% if flag?(:aarch64) %} + Atomic::Ops.fence :sequentially_consistent, false + {% end %} {% end %} end def unlock {% if flag?(:preview_mt) %} + {% if flag?(:aarch64) %} + Atomic::Ops.fence :sequentially_consistent, false + {% end %} @m.lazy_set(0) {% end %} end