[libc] Add simple implementations of mtx_lock and mtx_unlock.
authorSiva Chandra Reddy <sivachandra@google.com>
Mon, 10 Feb 2020 07:33:38 +0000 (23:33 -0800)
committerSiva Chandra Reddy <sivachandra@google.com>
Tue, 10 Mar 2020 04:56:02 +0000 (21:56 -0700)
commit550be40515df7135a8628a1abe57b845570645dd
tree6183880d62486c0a42e8ecabb08ac8942067c276
parentfd8c13361348f32acef8f8a972984bb5f0786a0c
[libc] Add simple implementations of mtx_lock and mtx_unlock.

These functions only support locking and unlocking of plain mutexes.
They will be extended in future changes to handled recursive and timed
mutexes.

Reviewers: phosek

Differential Revision: https://reviews.llvm.org/D74653
12 files changed:
libc/config/linux/api.td
libc/lib/CMakeLists.txt
libc/src/threads/linux/CMakeLists.txt
libc/src/threads/linux/mtx_init.cpp [new file with mode: 0644]
libc/src/threads/linux/mtx_lock.cpp [new file with mode: 0644]
libc/src/threads/linux/mtx_unlock.cpp [new file with mode: 0644]
libc/src/threads/linux/thread_utils.h
libc/src/threads/mtx_init.h [new file with mode: 0644]
libc/src/threads/mtx_lock.h [new file with mode: 0644]
libc/src/threads/mtx_unlock.h [new file with mode: 0644]
libc/test/src/threads/CMakeLists.txt
libc/test/src/threads/mtx_test.cpp [new file with mode: 0644]