Skip to content

Commit 84e705e

Browse files
committed
Fix RP2040 task lock acquire ordering
1 parent 49cec3e commit 84e705e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

portable/ThirdParty/GCC/RP2040/include/portmacro.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ static inline void vPortRecursiveLock( BaseType_t xCoreID,
237237
}
238238
spin_lock_unsafe_blocking(pxSpinLock);
239239
}
240+
else
241+
{
242+
/* spin_try_lock_unsafe() does not provide acquire ordering on the fast path. */
243+
__mem_fence_acquire();
244+
}
240245
configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 );
241246
ucRecursionCountByLock[ ulLockNum ] = 1;
242247
ucOwnedByCore[ xCoreID ][ ulLockNum ] = 1;

0 commit comments

Comments
 (0)