diff --git a/portable/ThirdParty/GCC/RP2040/include/portmacro.h b/portable/ThirdParty/GCC/RP2040/include/portmacro.h index d8173716eea..4e72bb07dc1 100644 --- a/portable/ThirdParty/GCC/RP2040/include/portmacro.h +++ b/portable/ThirdParty/GCC/RP2040/include/portmacro.h @@ -237,6 +237,11 @@ static inline void vPortRecursiveLock( BaseType_t xCoreID, } spin_lock_unsafe_blocking(pxSpinLock); } + else + { + /* spin_try_lock_unsafe() does not provide acquire ordering on the fast path. */ + __mem_fence_acquire(); + } configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 ); ucRecursionCountByLock[ ulLockNum ] = 1; ucOwnedByCore[ xCoreID ][ ulLockNum ] = 1;