[libc] Add implementation of pthread_once.
authorSiva Chandra Reddy <sivachandra@google.com>
Tue, 27 Sep 2022 08:13:16 +0000 (08:13 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Wed, 28 Sep 2022 06:54:48 +0000 (06:54 +0000)
commit3367539010870ae05d7ff5677734357f3a6c965f
tree5f861035fbdda0a4ff6d1183bc3d8c6cf0759391
parent18f954e7159e0728be0a4382aea8ccbb7fa502c5
[libc] Add implementation of pthread_once.

The existing thrd_once function has been refactored so that the
implementation can be shared between thrd_once and pthread_once
functions.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D134716
20 files changed:
libc/config/linux/api.td
libc/config/linux/x86_64/entrypoints.txt
libc/include/CMakeLists.txt
libc/include/llvm-libc-types/CMakeLists.txt
libc/include/llvm-libc-types/__pthread_once_func_t.h [new file with mode: 0644]
libc/include/llvm-libc-types/pthread_once_t.h [new file with mode: 0644]
libc/include/pthread.h.def
libc/spec/posix.td
libc/src/__support/threads/CMakeLists.txt
libc/src/__support/threads/callonce.h [new file with mode: 0644]
libc/src/__support/threads/linux/callonce.cpp [new file with mode: 0644]
libc/src/pthread/CMakeLists.txt
libc/src/pthread/pthread_once.cpp [new file with mode: 0644]
libc/src/pthread/pthread_once.h [new file with mode: 0644]
libc/src/threads/CMakeLists.txt
libc/src/threads/call_once.cpp [new file with mode: 0644]
libc/src/threads/call_once.h
libc/src/threads/linux/CMakeLists.txt
libc/test/integration/src/pthread/CMakeLists.txt
libc/test/integration/src/pthread/pthread_once_test.cpp [new file with mode: 0644]