[libc] Add pthread_detach and thrd_detach.
authorSiva Chandra Reddy <sivachandra@google.com>
Sat, 4 Jun 2022 14:33:49 +0000 (14:33 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Sat, 11 Jun 2022 05:29:40 +0000 (05:29 +0000)
commit5db4177817a8ba0f9a55184da12581abc4b65d7f
tree93c4d64f95dd3d4d2a6bd0acd13cf645741dc1d1
parente06faedf1d3a5a719c963e16ededb340e8b788b7
[libc] Add pthread_detach and thrd_detach.

Tests for pthread_detach and thrd_detach have not been added. Instead, a
test for the underlying implementation has been added as it makes use of
an internal wait method to synchronize with detached threads.

Reviewed By: lntue, michaelrj

Differential Revision: https://reviews.llvm.org/D127479
15 files changed:
libc/config/linux/x86_64/entrypoints.txt
libc/spec/posix.td
libc/spec/stdc.td
libc/src/__support/threads/CMakeLists.txt
libc/src/__support/threads/linux/thread.h
libc/src/__support/threads/thread_attrib.h
libc/src/pthread/CMakeLists.txt
libc/src/pthread/pthread_detach.cpp [new file with mode: 0644]
libc/src/pthread/pthread_detach.h [new file with mode: 0644]
libc/src/threads/CMakeLists.txt
libc/src/threads/thrd_detach.cpp [new file with mode: 0644]
libc/src/threads/thrd_detach.h [new file with mode: 0644]
libc/test/src/__support/CMakeLists.txt
libc/test/src/__support/threads/CMakeLists.txt [new file with mode: 0644]
libc/test/src/__support/threads/thread_detach_test.cpp [new file with mode: 0644]