mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-10-10 08:02:57 -04:00
Add comment explaining HolderFromISR/SMP TOCTOU
On SMP systems, xSemaphoreGetMutexHolderFromISR() is particularly difficult to use - note the footgun. See also espressif/esp-idf#18913
This commit is contained in:
parent
8be86d4a24
commit
8db1d0d1a3
1 changed files with 1 additions and 0 deletions
|
|
@ -1157,6 +1157,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
||||||
* by a task), return NULL.
|
* by a task), return NULL.
|
||||||
*
|
*
|
||||||
|
* Note: On SMP systems, the return value may be invalidated by other core(s).
|
||||||
*/
|
*/
|
||||||
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
||||||
#define xSemaphoreGetMutexHolderFromISR( xSemaphore ) xQueueGetMutexHolderFromISR( ( xSemaphore ) )
|
#define xSemaphoreGetMutexHolderFromISR( xSemaphore ) xQueueGetMutexHolderFromISR( ( xSemaphore ) )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue