[libcxx-commits] [libcxx] 3481e5d - [libcxx] Use mtx_plain | mtx_recursive following C11 API

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 15 15:15:51 PST 2020


Author: Petr Hosek
Date: 2020-01-15T15:15:39-08:00
New Revision: 3481e5d7ed08d068a4e3427cb1afcd8bf2acafdc

URL: https://github.com/llvm/llvm-project/commit/3481e5d7ed08d068a4e3427cb1afcd8bf2acafdc
DIFF: https://github.com/llvm/llvm-project/commit/3481e5d7ed08d068a4e3427cb1afcd8bf2acafdc.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

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 libcxx-commits mailing list