[llvm-branch-commits] [libcxx] f06cd8c - [libcxx] Use mtx_plain | mtx_recursive following C11 API
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jan 17 01:12:49 PST 2020
Author: Petr Hosek
Date: 2020-01-17T10:12:05+01:00
New Revision: f06cd8c8c8e2adc5dad66a851bc1df1ecdd1b58e
URL: https://github.com/llvm/llvm-project/commit/f06cd8c8c8e2adc5dad66a851bc1df1ecdd1b58e
DIFF: https://github.com/llvm/llvm-project/commit/f06cd8c8c8e2adc5dad66a851bc1df1ecdd1b58e.diff
LOG: [libcxx] Use mtx_plain | mtx_recursive following C11 API
The C11 API specifies that to initialize a recursive mutex,
mtx_plain | mtx_recursive should be used with mtx_init.
Differential Revision: https://reviews.llvm.org/D72809
(cherry picked from commit 3481e5d7ed08d068a4e3427cb1afcd8bf2acafdc)
Added:
Modified:
libcxx/include/__threading_support
Removed:
################################################################################
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support
index 026429f6a8ec..dbf313a1bf22 100644
--- a/libcxx/include/__threading_support
+++ b/libcxx/include/__threading_support
@@ -445,7 +445,7 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
{
- return mtx_init(__m, mtx_recursive) == thrd_success ? 0 : EINVAL;
+ return mtx_init(__m, mtx_plain | mtx_recursive) == thrd_success ? 0 : EINVAL;
}
int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m)
More information about the llvm-branch-commits
mailing list