diff options
Diffstat (limited to 'contrib/libc++/include/mutex')
-rw-r--r-- | contrib/libc++/include/mutex | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/contrib/libc++/include/mutex b/contrib/libc++/include/mutex index c047cf9..8526533 100644 --- a/contrib/libc++/include/mutex +++ b/contrib/libc++/include/mutex @@ -206,7 +206,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD class _LIBCPP_TYPE_VIS recursive_mutex { - __libcpp_mutex_t __m_; + __libcpp_recursive_mutex_t __m_; public: recursive_mutex(); @@ -221,7 +221,8 @@ public: bool try_lock() _NOEXCEPT; void unlock() _NOEXCEPT; - typedef __libcpp_mutex_t* native_handle_type; + typedef __libcpp_recursive_mutex_t* native_handle_type; + _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;} }; @@ -465,7 +466,7 @@ void __unlock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) { #endif // !_LIBCPP_HAS_NO_THREADS -struct _LIBCPP_TYPE_VIS_ONLY once_flag; +struct _LIBCPP_TEMPLATE_VIS once_flag; #ifndef _LIBCPP_HAS_NO_VARIADICS @@ -485,7 +486,7 @@ void call_once(once_flag&, const _Callable&); #endif // _LIBCPP_HAS_NO_VARIADICS -struct _LIBCPP_TYPE_VIS_ONLY once_flag +struct _LIBCPP_TEMPLATE_VIS once_flag { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR @@ -574,7 +575,7 @@ inline _LIBCPP_INLINE_VISIBILITY void call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) { - if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul) + if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) { typedef tuple<_Callable&&, _Args&&...> _Gp; _Gp __f(_VSTD::forward<_Callable>(__func), _VSTD::forward<_Args>(__args)...); @@ -590,7 +591,7 @@ inline _LIBCPP_INLINE_VISIBILITY void call_once(once_flag& __flag, _Callable& __func) { - if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul) + if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) { __call_once_param<_Callable> __p(__func); __call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>); @@ -615,7 +616,7 @@ call_once(once_flag& __flag, const _Callable& __func) #if defined(_LIBCPP_ABI_VARIADIC_LOCK_GUARD) \ && !defined(_LIBCPP_CXX03_LANG) template <> -class _LIBCPP_TYPE_VIS_ONLY lock_guard<> { +class _LIBCPP_TEMPLATE_VIS lock_guard<> { public: explicit lock_guard() {} ~lock_guard() = default; @@ -628,7 +629,7 @@ public: }; template <class ..._MArgs> -class _LIBCPP_TYPE_VIS_ONLY lock_guard +class _LIBCPP_TEMPLATE_VIS lock_guard { static_assert(sizeof...(_MArgs) >= 2, "At least 2 lock types required"); typedef tuple<_MArgs&...> _MutexTuple; |