mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-10-09 23:53:04 -04:00
Fix RP2040 task lock acquire ordering
Add an acquire fence after the RP2040 recursive lock fast path because spin_try_lock_unsafe() does not provide acquire ordering when the lock is acquired immediately. Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
This commit is contained in:
parent
78069a79ea
commit
de106e32b5
1 changed files with 5 additions and 0 deletions
|
|
@ -237,6 +237,11 @@ static inline void vPortRecursiveLock( BaseType_t xCoreID,
|
||||||
}
|
}
|
||||||
spin_lock_unsafe_blocking(pxSpinLock);
|
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 );
|
configASSERT( ucRecursionCountByLock[ ulLockNum ] == 0 );
|
||||||
ucRecursionCountByLock[ ulLockNum ] = 1;
|
ucRecursionCountByLock[ ulLockNum ] = 1;
|
||||||
ucOwnedByCore[ xCoreID ][ ulLockNum ] = 1;
|
ucOwnedByCore[ xCoreID ][ ulLockNum ] = 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue