[LIBC] Fix incorrect behavior with pthread_key_t when value was nullptr
authorNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Apr 2023 00:33:32 +0000 (19:33 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Apr 2023 00:54:56 +0000 (19:54 -0500)
commit6f1a9ed072de612584a90adf3469744781da17fc
tree88b11e1f087409b6b1feec56e237cba98a96ff6e
parentde27291e25f7398b0b36c0f388eaf272b2b54e37
[LIBC] Fix incorrect behavior with pthread_key_t when value was nullptr

We should not call destructor if value is nullptr.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D148291
libc/src/__support/threads/thread.cpp
libc/test/integration/src/pthread/pthread_tss_test.cpp