[libcxx-commits] [libcxx] [libc++] add shared_recursive_mutex api (PR #82466)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Mar 16 22:27:27 PDT 2024
================
@@ -0,0 +1,122 @@
+#include <cassert>
+#include <shared_recursive_mutex>
+
+constexpr uint32_t SHARED_USER_MAX_CNT = UINT32_MAX;
+constexpr pthread_t THREAD_ID_NOEXIST = 0;
+
+using namespace std;
+
+#ifndef likely
+# define likely(condition) __builtin_expect(!!(condition), 1)
+#endif
+#ifndef unlikely
+# define unlikely(condition) __builtin_expect(!!(condition), 0)
+#endif
+
+void shared_recursive_mutex::lock() {
+ pthread_t self = pthread_self();
----------------
Jolyon0202 wrote:
Thx. I have updated a new version of this patch.
https://github.com/llvm/llvm-project/pull/82466
More information about the libcxx-commits
mailing list