1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 #ifndef _LIBCPP_HAS_NO_THREADS
14 # if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
15 # pragma comment(lib, "pthread")
19 _LIBCPP_BEGIN_NAMESPACE_STD
21 #ifndef _LIBCPP_HAS_NO_THREADS
22 static constinit __libcpp_mutex_t __rs_mut
= _LIBCPP_MUTEX_INITIALIZER
;
24 unsigned __rs_default::__c_
= 0;
26 __rs_default::__rs_default()
28 #ifndef _LIBCPP_HAS_NO_THREADS
29 __libcpp_mutex_lock(&__rs_mut
);
34 __rs_default::__rs_default(const __rs_default
&)
39 __rs_default::~__rs_default()
41 #ifndef _LIBCPP_HAS_NO_THREADS
43 __libcpp_mutex_unlock(&__rs_mut
);
49 __rs_default::result_type
50 __rs_default::operator()()
52 static mt19937 __rs_g
;
59 return __rs_default();
62 _LIBCPP_END_NAMESPACE_STD