Updated May 2025
xQueueRemoveFromSet
queue.h
1BaseType_t xQueueRemoveFromSet2 (3 QueueSetMemberHandle_t xQueueOrSemaphore,4 QueueSetHandle_t xQueueSet5 );
configUSE_QUEUE_SETS must be set to 1 in FreeRTOSConfig.h for the xQueueRemoveFromSet() API function to be available.
Remove an RTOS queue or semaphore from a queue set.
An RTOS queue or semaphore can only be removed from a queue set if the queue or semaphore is empty.
Parameters:
-
xQueueOrSemaphore
The handle of the queue or semaphore being removed from the queue set (cast to an QueueSetMemberHandle_t type).
-
xQueueSet
The handle of the queue set in which the queue or semaphore is included.
Returns:
If the queue or semaphore was successfully removed from the queue set then pdPASS is returned. If the queue was not in the queue set, or the queue (or semaphore) was not empty, then pdFAIL is returned.
Example usage:
This example assumes xQueueSet is a queue set that has already been created, and xQueue is a queue that has already been created and added to xQueueSet.
1 if( xQueueRemoveFromSet( xQueue, xQueueSet ) != pdPASS )2 {3 /* Either xQueue was not a member of the xQueueSet set, or xQueue is4 not empty and therefore cannot be removed from the set. */5 }6 else7 {8 /* The queue was successfully removed from the set. */9 }