Skip to content

Commit 1585b15

Browse files
feat(freertos-smp): Update queueUNLOCK() to receive yield status
1 parent 49b89b2 commit 1585b15

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

queue.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -346,18 +346,19 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
346346
taskDATA_GROUP_LOCK( &( ( pxQueue )->xTaskSpinlock ) ); \
347347
prvLockQueue( ( pxQueue ) ); \
348348
} while( 0 )
349-
#define queueUNLOCK( pxQueue, xYieldAPI ) \
350-
do { \
351-
prvUnlockQueue( ( pxQueue ) ); \
352-
taskDATA_GROUP_UNLOCK( &( ( pxQueue )->xTaskSpinlock ) ); \
353-
if( ( xYieldAPI ) == pdTRUE ) \
354-
{ \
355-
taskYIELD_WITHIN_API(); \
356-
} \
357-
else \
358-
{ \
359-
mtCOVERAGE_TEST_MARKER(); \
360-
} \
349+
#define queueUNLOCK( pxQueue, xYieldAPI ) \
350+
do { \
351+
BaseType_t xAlreadyYielded; \
352+
prvUnlockQueue( ( pxQueue ) ); \
353+
xAlreadyYielded = taskDATA_GROUP_UNLOCK( &( ( pxQueue )->xTaskSpinlock ) ); \
354+
if( ( xAlreadyYielded == pdFALSE ) && ( ( xYieldAPI ) == pdTRUE ) ) \
355+
{ \
356+
taskYIELD_WITHIN_API(); \
357+
} \
358+
else \
359+
{ \
360+
mtCOVERAGE_TEST_MARKER(); \
361+
} \
361362
} while( 0 )
362363
#else /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
363364
#define queueLOCK( pxQueue ) \

0 commit comments

Comments
 (0)