diff options
Diffstat (limited to 'lib/libcxx/src/mutex.cpp')
| -rw-r--r-- | lib/libcxx/src/mutex.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/libcxx/src/mutex.cpp b/lib/libcxx/src/mutex.cpp index d6758fb0ef..01b7420fa3 100644 --- a/lib/libcxx/src/mutex.cpp +++ b/lib/libcxx/src/mutex.cpp @@ -6,19 +6,24 @@ // //===----------------------------------------------------------------------===// -#include "mutex" -#include "limits" -#include "system_error" +#include <__assert> +#include <limits> +#include <mutex> +#include <system_error> + #include "include/atomic_support.h" -#include "__undef_macros" #ifndef _LIBCPP_HAS_NO_THREADS -#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB) -#pragma comment(lib, "pthread") -#endif +# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB) +# pragma comment(lib, "pthread") +# endif #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD + #ifndef _LIBCPP_HAS_NO_THREADS const defer_lock_t defer_lock{}; @@ -196,8 +201,8 @@ recursive_timed_mutex::unlock() noexcept // keep in sync with: 7741191. #ifndef _LIBCPP_HAS_NO_THREADS -_LIBCPP_SAFE_STATIC static __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER; -_LIBCPP_SAFE_STATIC static __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER; +static constinit __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER; +static constinit __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER; #endif void __call_once(volatile once_flag::_State_type& flag, void* arg, @@ -258,3 +263,5 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg, } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS |
