mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-24 09:30:15 +00:00
'Merge branch 'thread_local_storage_delete_callbacks' into 'master'
The thread-local-storage feature in FreeRTOS attaches an application-usable array of pointers to a thread control block. These pointers usually point to a structure the thread allocates. When a thread gets (voluntarily or involuntarily) destroyed, this memory can leak. This merge adds a matching second array of user-settable pointers to destructor routines. As soon as the task gets cleaned up (which happens in the idle thread), the destructors get called and the memory can be freed. See merge request !19
This commit is contained in:
@@ -1175,6 +1175,11 @@ constant. */
|
||||
void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue ) PRIVILEGED_FUNCTION;
|
||||
void *pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
|
||||
typedef void (*TlsDeleteCallbackFunction_t)( int, void * );
|
||||
void vTaskSetThreadLocalStoragePointerAndDelCallback( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue , TlsDeleteCallbackFunction_t xDelCallback);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user