summaryrefslogtreecommitdiff
path: root/libc/src/threads
diff options
context:
space:
mode:
authorSchrodinger ZHU Yifan <yifanzhu@rochester.edu>2024-05-31 18:57:18 -0700
committerGitHub <noreply@github.com>2024-05-31 18:57:18 -0700
commit142afde0eba4940f2b331274e9a3535fee960f35 (patch)
tree5dc87260d5607ece707ccea6dcfe0234776dae12 /libc/src/threads
parentd337c504ef3652e9ccd75b21bbc79d010ee6c637 (diff)
[libc] rework mutex (#92168)
Diffstat (limited to 'libc/src/threads')
-rw-r--r--libc/src/threads/linux/CMakeLists.txt1
-rw-r--r--libc/src/threads/mtx_init.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/libc/src/threads/linux/CMakeLists.txt b/libc/src/threads/linux/CMakeLists.txt
index a5a02e47aab3..6c8e0845faf4 100644
--- a/libc/src/threads/linux/CMakeLists.txt
+++ b/libc/src/threads/linux/CMakeLists.txt
@@ -9,6 +9,7 @@ add_header_library(
libc.src.__support.CPP.mutex
libc.src.__support.OSUtil.osutil
libc.src.__support.threads.mutex
+ libc.src.__support.threads.linux.raw_mutex
libc.src.__support.threads.linux.futex_utils
)
diff --git a/libc/src/threads/mtx_init.cpp b/libc/src/threads/mtx_init.cpp
index 74d08d33b116..7cd848d12ee6 100644
--- a/libc/src/threads/mtx_init.cpp
+++ b/libc/src/threads/mtx_init.cpp
@@ -20,7 +20,8 @@ static_assert(sizeof(Mutex) <= sizeof(mtx_t),
LLVM_LIBC_FUNCTION(int, mtx_init, (mtx_t * m, int type)) {
auto err = Mutex::init(reinterpret_cast<Mutex *>(m), type & mtx_timed,
- type & mtx_recursive, 0);
+ type & mtx_recursive, /* is_robust */ false,
+ /* is_pshared */ false);
return err == MutexError::NONE ? thrd_success : thrd_error;
}