Skip to content

Commit

Permalink
Update recursive mutex design
Browse files Browse the repository at this point in the history
  • Loading branch information
kar-rahul-aws committed Jan 15, 2025
1 parent e21ae2c commit 2d25c10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion light-weight-mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{
taskENTER_CRITICAL();
{
if( Atomic_CompareAndSwap_u32( &pxMutex->owner, ( uintptr_t ) currentTask, expectedOwner ) || ( expectedOwner == ( uintptr_t ) currentTask ) )
if( ( Atomic_CompareAndSwap_u32( &pxMutex->owner, ( uintptr_t ) currentTask, expectedOwner ) ) || ( Atomic_Load_u32( &pxMutex->owner ) == ( uintptr_t ) currentTask ) )
{
pxMutex->lock_count++;
xReturn = pdTRUE;
Expand Down

0 comments on commit 2d25c10

Please sign in to comment.