esp-idf/components/pthread
Myk Melez 4e22d115b7 fix(pthread): Remove TLS pointer/deletion callback from correct thread
Originally, pthread_internal_local_storage_destructor_callback was only called from pthread_exit
on the thread whose TLS is being destroyed.

In b3755b751e, pthread_internal_local_storage_destructor_callback
started being called from pthread_join and pthread_detach on a different thread (whichever one
called one of those functions).

But pthread_internal_local_storage_destructor_callback is still calling
vTaskSetThreadLocalStoragePointer and vTaskSetThreadLocalStoragePointerAndDelCallback with a NULL
xTaskToSet argument, which causes those functions to set the TLS pointer and deletion callback
for the current thread, not the thread whose TLS is being destroyed.

This commit makes pthread_internal_local_storage_destructor_callback call
vTaskSetThreadLocalStoragePointer and vTaskSetThreadLocalStoragePointerAndDelCallback
with the handle of the thread whose TLS is being destroyed.
2024-07-02 13:33:20 +08:00
..
include pthread: Implemented POSIX unnamed semaphore 2023-03-21 10:23:58 +08:00
test_apps/pthread_unity_tests pthread: Implemented POSIX unnamed semaphore 2023-03-21 10:23:58 +08:00
CMakeLists.txt fix(pthread): fixed pthread_condvar linker hook 2023-09-18 12:31:25 +08:00
Kconfig pthread: remove ESP32_ prefix from Kconfig options 2019-07-29 04:43:49 +02:00
pthread_cond_var.c pthread: avoid heap alloc in pthread_cond_timedwait 2023-03-10 15:52:27 +08:00
pthread_internal.h pthread: Remove pthread TLS cleanup dependency on FreeRTOS Static Task Cleanup Hook 2022-11-02 09:52:28 +01:00
pthread_local_storage.c fix(pthread): Remove TLS pointer/deletion callback from correct thread 2024-07-02 13:33:20 +08:00
pthread_rwlock.c feat (pthread): reader-writer locks implementation 2021-11-03 16:38:14 +08:00
pthread_semaphore.c pthread: Implemented POSIX unnamed semaphore 2023-03-21 10:23:58 +08:00
pthread.c pthread: fix and re-enable no-format warnings 2023-03-12 21:49:57 +01:00
sdkconfig.rename pthread: remove ESP32_ prefix from Kconfig options 2019-07-29 04:43:49 +02:00