Skip to content

Commit

Permalink
Further optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
kar-rahul-aws committed Jan 17, 2025
1 parent fbdda80 commit 1d9f239
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions light-weight-mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
{
TaskHandle_t currentTask = xTaskGetCurrentTaskHandle();
BaseType_t xReturn = pdFALSE;
BaseType_t xInheritanceOccurred = pdFALSE;
TickType_t startTime = xTaskGetTickCount();

/* Check the pxMutex pointer is not NULL. */
Expand All @@ -52,6 +51,7 @@
pxMutex->lock_count = 1;
if( uxTaskPriorityGet( currentTask ) < pxMutex->uxCeilingPriority )
{
BaseType_t xInheritanceOccurred = pdFALSE;
vInsertMutexToHolderList( currentTask, &( pxMutex->xMutexHolderListItem ) );
xInheritanceOccurred = xTaskCeilingPriorityInherit( pxMutex->uxCeilingPriority );
}
Expand All @@ -77,16 +77,16 @@
/* Get the ceiling priority of next mutex held.
* If it not there set to base priority.
*/
LightWeightMutex_t * pxNextMutex = pvRemoveMutexToHolderList( ( void * const ) pxMutex );

if( pxNextMutex != NULL )
{
xTaskCeilingPriorityDisInherit( pxNextMutex->uxCeilingPriority );
}
else
{
xTaskCeilingPriorityDisInheritToBasePrio();
}
// LightWeightMutex_t * pxNextMutex = pvRemoveMutexToHolderList( ( void * const ) pxMutex );

// if( pxNextMutex != NULL )
// {
// xTaskCeilingPriorityDisInherit( pxNextMutex->uxCeilingPriority );
// }
// else
// {
// xTaskCeilingPriorityDisInheritToBasePrio();
// }

xReturn = pdFALSE;
taskEXIT_CRITICAL();
Expand Down

0 comments on commit 1d9f239

Please sign in to comment.