[libc][NFC] Add a platform independent thread support library.
authorSiva Chandra Reddy <sivachandra@google.com>
Sat, 26 Feb 2022 01:18:19 +0000 (01:18 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Fri, 4 Mar 2022 18:33:46 +0000 (18:33 +0000)
commita5ee8183c049d377539c2b6452c8817589dd2df4
tree9a9d94a628d32c8ac1d7ce35b5d0534d1576fb78
parent7e1355eb1327ffa94f680e925e266b9404392f32
[libc][NFC] Add a platform independent thread support library.

The idea is that, other parts of the libc which require thread/lock
support will be able to use this platform independent setup.

With this change, only the linux implementation of a mutex type has been
moved to the new library. Because of this, there is some duplication
between the new library and src/threads/linux. A follow up change will
move all of src/threads/linux to the new library. The duplication should
be eliminated with that move.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D120795
17 files changed:
libc/include/llvm-libc-types/CMakeLists.txt
libc/include/llvm-libc-types/__mutex_type.h [new file with mode: 0644]
libc/include/llvm-libc-types/mtx_t.h
libc/src/__support/CMakeLists.txt
libc/src/__support/threads/CMakeLists.txt [new file with mode: 0644]
libc/src/__support/threads/linux/CMakeLists.txt [new file with mode: 0644]
libc/src/__support/threads/linux/mutex.h [new file with mode: 0644]
libc/src/__support/threads/mutex.h [new file with mode: 0644]
libc/src/threads/CMakeLists.txt
libc/src/threads/linux/CMakeLists.txt
libc/src/threads/linux/CndVar.h
libc/src/threads/linux/Mutex.h [deleted file]
libc/src/threads/linux/cnd_wait.cpp
libc/src/threads/mtx_destroy.cpp [moved from libc/src/threads/linux/mtx_destroy.cpp with 93% similarity]
libc/src/threads/mtx_init.cpp [moved from libc/src/threads/linux/mtx_init.cpp with 70% similarity]
libc/src/threads/mtx_lock.cpp [moved from libc/src/threads/linux/mtx_lock.cpp with 78% similarity]
libc/src/threads/mtx_unlock.cpp [moved from libc/src/threads/linux/mtx_unlock.cpp with 78% similarity]