[LIBC] Fix incorrect handling of `pthread_join(tid, nullptr)`
authorNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Apr 2023 19:50:00 +0000 (14:50 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Thu, 20 Apr 2023 19:53:37 +0000 (14:53 -0500)
commitef0949828e15d28a92ea04b84d803f1e05bdb1d6
tree6e0db9698c7b6e377f18fe38f428c049b8a0a4be
parent8d2bae9abdc30e104bab00a4dd0f9d39f5bdda6e
[LIBC] Fix incorrect handling of `pthread_join(tid, nullptr)`

Previously unconditionally stored to the return value. This is
incorrect, we should only return if user value is non-null.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D148293
libc/src/__support/threads/thread.h
libc/test/integration/src/pthread/CMakeLists.txt
libc/test/integration/src/pthread/pthread_join_test.cpp [new file with mode: 0644]