blob: 364c69e45d6891f353cbcf350bd6b125d484d080 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:161// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
Howard Hinnantf5256e12010-05-11 21:36:014// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:165//
Howard Hinnantb64f8b02010-11-16 22:09:026// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:168//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP___MUTEX_BASE
12#define _LIBCPP___MUTEX_BASE
13
14#include <__config>
15#include <chrono>
16#include <system_error>
Jonathan Roelofs044df632015-08-27 17:47:3417#ifndef _LIBCPP_HAS_NO_THREADS
Howard Hinnantbc8d3f92010-05-11 19:42:1618#include <pthread.h>
Jonathan Roelofs044df632015-08-27 17:47:3419#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1620
Howard Hinnant08e17472011-10-17 20:05:1021#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Howard Hinnantbc8d3f92010-05-11 19:42:1622#pragma GCC system_header
Howard Hinnant08e17472011-10-17 20:05:1023#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1624
25_LIBCPP_BEGIN_NAMESPACE_STD
26
Jonathan Roelofs8d86b2e2014-09-05 19:45:0527#ifndef _LIBCPP_HAS_NO_THREADS
28
Eric Fiseliera15e8c32016-03-16 02:30:0629#ifndef _LIBCPP_THREAD_SAFETY_ANNOTATION
30# ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
31# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x))
32# else
33# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
34# endif
35#endif // _LIBCPP_THREAD_SAFETY_ANNOTATION
36
37class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
Howard Hinnantbc8d3f92010-05-11 19:42:1638{
39 pthread_mutex_t __m_;
40
41public:
Howard Hinnant333f50d2010-09-21 20:16:3742 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant384608e2012-07-07 20:01:5243#ifndef _LIBCPP_HAS_NO_CONSTEXPR
Howard Hinnant5c90cba2012-09-11 16:10:2044 constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
Howard Hinnant384608e2012-07-07 20:01:5245#else
Howard Hinnant499c61f2012-07-21 16:13:0946 mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
Howard Hinnant384608e2012-07-07 20:01:5247#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1648 ~mutex();
49
50private:
51 mutex(const mutex&);// = delete;
52 mutex& operator=(const mutex&);// = delete;
53
54public:
Eric Fiseliera15e8c32016-03-16 02:30:0655 void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability());
56 bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
57 void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
Howard Hinnantbc8d3f92010-05-11 19:42:1658
59 typedef pthread_mutex_t* native_handle_type;
Howard Hinnant333f50d2010-09-21 20:16:3760 _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
Howard Hinnantbc8d3f92010-05-11 19:42:1661};
62
Howard Hinnant83eade62013-03-06 23:30:1963struct _LIBCPP_TYPE_VIS defer_lock_t {};
64struct _LIBCPP_TYPE_VIS try_to_lock_t {};
65struct _LIBCPP_TYPE_VIS adopt_lock_t {};
Howard Hinnantbc8d3f92010-05-11 19:42:1666
Howard Hinnant499c61f2012-07-21 16:13:0967#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)
Howard Hinnantbc8d3f92010-05-11 19:42:1668
Howard Hinnant499c61f2012-07-21 16:13:0969extern const defer_lock_t defer_lock;
70extern const try_to_lock_t try_to_lock;
71extern const adopt_lock_t adopt_lock;
Howard Hinnantbc8d3f92010-05-11 19:42:1672
Howard Hinnant499c61f2012-07-21 16:13:0973#else
74
75constexpr defer_lock_t defer_lock = defer_lock_t();
76constexpr try_to_lock_t try_to_lock = try_to_lock_t();
77constexpr adopt_lock_t adopt_lock = adopt_lock_t();
78
79#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1680
81template <class _Mutex>
Eric Fiseliera15e8c32016-03-16 02:30:0682class _LIBCPP_TYPE_VIS_ONLY _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable) lock_guard
Howard Hinnantbc8d3f92010-05-11 19:42:1683{
84public:
85 typedef _Mutex mutex_type;
86
87private:
88 mutex_type& __m_;
89public:
90
Howard Hinnant333f50d2010-09-21 20:16:3791 _LIBCPP_INLINE_VISIBILITY
Eric Fiseliera15e8c32016-03-16 02:30:0692 explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
Howard Hinnantbc8d3f92010-05-11 19:42:1693 : __m_(__m) {__m_.lock();}
Howard Hinnant333f50d2010-09-21 20:16:3794 _LIBCPP_INLINE_VISIBILITY
Eric Fiseliera15e8c32016-03-16 02:30:0695 lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
Howard Hinnantbc8d3f92010-05-11 19:42:1696 : __m_(__m) {}
Howard Hinnant333f50d2010-09-21 20:16:3797 _LIBCPP_INLINE_VISIBILITY
Eric Fiseliera15e8c32016-03-16 02:30:0698 ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
Howard Hinnantbc8d3f92010-05-11 19:42:1699
100private:
101 lock_guard(lock_guard const&);// = delete;
102 lock_guard& operator=(lock_guard const&);// = delete;
103};
104
105template <class _Mutex>
Howard Hinnant0f678bd2013-08-12 18:38:34106class _LIBCPP_TYPE_VIS_ONLY unique_lock
Howard Hinnantbc8d3f92010-05-11 19:42:16107{
108public:
109 typedef _Mutex mutex_type;
110
111private:
112 mutex_type* __m_;
113 bool __owns_;
114
115public:
Howard Hinnant333f50d2010-09-21 20:16:37116 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09117 unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
Howard Hinnant333f50d2010-09-21 20:16:37118 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16119 explicit unique_lock(mutex_type& __m)
Marshall Clow81652492016-04-13 17:02:23120 : __m_(_VSTD::addressof(__m)), __owns_(true) {__m_->lock();}
Howard Hinnant333f50d2010-09-21 20:16:37121 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09122 unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
Marshall Clow81652492016-04-13 17:02:23123 : __m_(_VSTD::addressof(__m)), __owns_(false) {}
Howard Hinnant333f50d2010-09-21 20:16:37124 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16125 unique_lock(mutex_type& __m, try_to_lock_t)
Marshall Clow81652492016-04-13 17:02:23126 : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock()) {}
Howard Hinnant333f50d2010-09-21 20:16:37127 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16128 unique_lock(mutex_type& __m, adopt_lock_t)
Marshall Clow81652492016-04-13 17:02:23129 : __m_(_VSTD::addressof(__m)), __owns_(true) {}
Howard Hinnantbc8d3f92010-05-11 19:42:16130 template <class _Clock, class _Duration>
Howard Hinnant333f50d2010-09-21 20:16:37131 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16132 unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
Marshall Clow81652492016-04-13 17:02:23133 : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
Howard Hinnantbc8d3f92010-05-11 19:42:16134 template <class _Rep, class _Period>
Howard Hinnant333f50d2010-09-21 20:16:37135 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16136 unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
Marshall Clow81652492016-04-13 17:02:23137 : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
Howard Hinnant333f50d2010-09-21 20:16:37138 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16139 ~unique_lock()
140 {
141 if (__owns_)
142 __m_->unlock();
143 }
144
145private:
146 unique_lock(unique_lock const&); // = delete;
147 unique_lock& operator=(unique_lock const&); // = delete;
148
149public:
Howard Hinnant73d21a42010-09-04 23:28:19150#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnant333f50d2010-09-21 20:16:37151 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09152 unique_lock(unique_lock&& __u) _NOEXCEPT
Howard Hinnantbc8d3f92010-05-11 19:42:16153 : __m_(__u.__m_), __owns_(__u.__owns_)
154 {__u.__m_ = nullptr; __u.__owns_ = false;}
Howard Hinnant333f50d2010-09-21 20:16:37155 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09156 unique_lock& operator=(unique_lock&& __u) _NOEXCEPT
Howard Hinnantbc8d3f92010-05-11 19:42:16157 {
158 if (__owns_)
159 __m_->unlock();
160 __m_ = __u.__m_;
161 __owns_ = __u.__owns_;
162 __u.__m_ = nullptr;
163 __u.__owns_ = false;
164 return *this;
165 }
Howard Hinnantac417fa2010-11-28 19:41:07166
Howard Hinnant73d21a42010-09-04 23:28:19167#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16168
169 void lock();
170 bool try_lock();
171
172 template <class _Rep, class _Period>
173 bool try_lock_for(const chrono::duration<_Rep, _Period>& __d);
174 template <class _Clock, class _Duration>
175 bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
176
177 void unlock();
178
Howard Hinnant333f50d2010-09-21 20:16:37179 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09180 void swap(unique_lock& __u) _NOEXCEPT
Howard Hinnantbc8d3f92010-05-11 19:42:16181 {
Howard Hinnant0949eed2011-06-30 21:18:19182 _VSTD::swap(__m_, __u.__m_);
183 _VSTD::swap(__owns_, __u.__owns_);
Howard Hinnantbc8d3f92010-05-11 19:42:16184 }
Howard Hinnant333f50d2010-09-21 20:16:37185 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09186 mutex_type* release() _NOEXCEPT
Howard Hinnantbc8d3f92010-05-11 19:42:16187 {
188 mutex_type* __m = __m_;
189 __m_ = nullptr;
190 __owns_ = false;
191 return __m;
192 }
193
Howard Hinnant333f50d2010-09-21 20:16:37194 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09195 bool owns_lock() const _NOEXCEPT {return __owns_;}
Howard Hinnant333f50d2010-09-21 20:16:37196 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant77861882012-02-21 21:46:43197 _LIBCPP_EXPLICIT
Howard Hinnant499c61f2012-07-21 16:13:09198 operator bool () const _NOEXCEPT {return __owns_;}
Howard Hinnant333f50d2010-09-21 20:16:37199 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant499c61f2012-07-21 16:13:09200 mutex_type* mutex() const _NOEXCEPT {return __m_;}
Howard Hinnantbc8d3f92010-05-11 19:42:16201};
202
203template <class _Mutex>
204void
205unique_lock<_Mutex>::lock()
206{
207 if (__m_ == nullptr)
208 __throw_system_error(EPERM, "unique_lock::lock: references null mutex");
209 if (__owns_)
210 __throw_system_error(EDEADLK, "unique_lock::lock: already locked");
211 __m_->lock();
212 __owns_ = true;
213}
214
215template <class _Mutex>
216bool
217unique_lock<_Mutex>::try_lock()
218{
219 if (__m_ == nullptr)
220 __throw_system_error(EPERM, "unique_lock::try_lock: references null mutex");
221 if (__owns_)
222 __throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
223 __owns_ = __m_->try_lock();
224 return __owns_;
225}
226
227template <class _Mutex>
228template <class _Rep, class _Period>
229bool
230unique_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d)
231{
232 if (__m_ == nullptr)
233 __throw_system_error(EPERM, "unique_lock::try_lock_for: references null mutex");
234 if (__owns_)
235 __throw_system_error(EDEADLK, "unique_lock::try_lock_for: already locked");
236 __owns_ = __m_->try_lock_for(__d);
237 return __owns_;
238}
239
240template <class _Mutex>
241template <class _Clock, class _Duration>
242bool
243unique_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
244{
245 if (__m_ == nullptr)
246 __throw_system_error(EPERM, "unique_lock::try_lock_until: references null mutex");
247 if (__owns_)
248 __throw_system_error(EDEADLK, "unique_lock::try_lock_until: already locked");
249 __owns_ = __m_->try_lock_until(__t);
250 return __owns_;
251}
252
253template <class _Mutex>
254void
255unique_lock<_Mutex>::unlock()
256{
257 if (!__owns_)
258 __throw_system_error(EPERM, "unique_lock::unlock: not locked");
259 __m_->unlock();
260 __owns_ = false;
261}
262
263template <class _Mutex>
Howard Hinnant333f50d2010-09-21 20:16:37264inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16265void
Howard Hinnant499c61f2012-07-21 16:13:09266swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
267 {__x.swap(__y);}
Howard Hinnantbc8d3f92010-05-11 19:42:16268
Marshall Clow239bc422013-12-23 22:14:27269//enum class cv_status
270_LIBCPP_DECLARE_STRONG_ENUM(cv_status)
Howard Hinnantbc8d3f92010-05-11 19:42:16271{
Marshall Clow239bc422013-12-23 22:14:27272 no_timeout,
273 timeout
Howard Hinnantbc8d3f92010-05-11 19:42:16274};
Marshall Clow239bc422013-12-23 22:14:27275_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
Howard Hinnantbc8d3f92010-05-11 19:42:16276
Howard Hinnant83eade62013-03-06 23:30:19277class _LIBCPP_TYPE_VIS condition_variable
Howard Hinnantbc8d3f92010-05-11 19:42:16278{
279 pthread_cond_t __cv_;
280public:
Howard Hinnant333f50d2010-09-21 20:16:37281 _LIBCPP_INLINE_VISIBILITY
Howard Hinnant384608e2012-07-07 20:01:52282#ifndef _LIBCPP_HAS_NO_CONSTEXPR
Howard Hinnant5c90cba2012-09-11 16:10:20283 constexpr condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {}
Howard Hinnant384608e2012-07-07 20:01:52284#else
Howard Hinnantbc8d3f92010-05-11 19:42:16285 condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
Howard Hinnant384608e2012-07-07 20:01:52286#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16287 ~condition_variable();
288
289private:
290 condition_variable(const condition_variable&); // = delete;
291 condition_variable& operator=(const condition_variable&); // = delete;
292
293public:
Howard Hinnantc8f74132012-07-21 16:32:53294 void notify_one() _NOEXCEPT;
295 void notify_all() _NOEXCEPT;
Howard Hinnantbc8d3f92010-05-11 19:42:16296
Marshall Clowb0767852014-03-26 02:45:04297 void wait(unique_lock<mutex>& __lk) _NOEXCEPT;
Howard Hinnantbc8d3f92010-05-11 19:42:16298 template <class _Predicate>
299 void wait(unique_lock<mutex>& __lk, _Predicate __pred);
300
Howard Hinnantbc8d3f92010-05-11 19:42:16301 template <class _Clock, class _Duration>
302 cv_status
303 wait_until(unique_lock<mutex>& __lk,
304 const chrono::time_point<_Clock, _Duration>& __t);
305
306 template <class _Clock, class _Duration, class _Predicate>
307 bool
308 wait_until(unique_lock<mutex>& __lk,
309 const chrono::time_point<_Clock, _Duration>& __t,
310 _Predicate __pred);
311
312 template <class _Rep, class _Period>
313 cv_status
314 wait_for(unique_lock<mutex>& __lk,
315 const chrono::duration<_Rep, _Period>& __d);
316
317 template <class _Rep, class _Period, class _Predicate>
318 bool
Evgeniy Stepanova3b25f82015-11-07 01:22:13319 _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16320 wait_for(unique_lock<mutex>& __lk,
321 const chrono::duration<_Rep, _Period>& __d,
322 _Predicate __pred);
323
324 typedef pthread_cond_t* native_handle_type;
Howard Hinnant333f50d2010-09-21 20:16:37325 _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
Howard Hinnantbc8d3f92010-05-11 19:42:16326
327private:
328 void __do_timed_wait(unique_lock<mutex>& __lk,
Marshall Clowb0767852014-03-26 02:45:04329 chrono::time_point<chrono::system_clock, chrono::nanoseconds>) _NOEXCEPT;
Howard Hinnantbc8d3f92010-05-11 19:42:16330};
Jonathan Roelofs8d86b2e2014-09-05 19:45:05331#endif // !_LIBCPP_HAS_NO_THREADS
Howard Hinnantbc8d3f92010-05-11 19:42:16332
333template <class _To, class _Rep, class _Period>
Howard Hinnant333f50d2010-09-21 20:16:37334inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16335typename enable_if
336<
337 chrono::__is_duration<_To>::value,
338 _To
339>::type
340__ceil(chrono::duration<_Rep, _Period> __d)
341{
342 using namespace chrono;
343 _To __r = duration_cast<_To>(__d);
344 if (__r < __d)
345 ++__r;
346 return __r;
347}
348
Jonathan Roelofs8d86b2e2014-09-05 19:45:05349#ifndef _LIBCPP_HAS_NO_THREADS
Howard Hinnantbc8d3f92010-05-11 19:42:16350template <class _Predicate>
351void
352condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred)
353{
354 while (!__pred())
355 wait(__lk);
356}
357
Howard Hinnantbc8d3f92010-05-11 19:42:16358template <class _Clock, class _Duration>
359cv_status
360condition_variable::wait_until(unique_lock<mutex>& __lk,
361 const chrono::time_point<_Clock, _Duration>& __t)
362{
363 using namespace chrono;
Howard Hinnantcf115d22012-08-30 19:14:33364 wait_for(__lk, __t - _Clock::now());
Howard Hinnantbc8d3f92010-05-11 19:42:16365 return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
366}
367
368template <class _Clock, class _Duration, class _Predicate>
369bool
370condition_variable::wait_until(unique_lock<mutex>& __lk,
371 const chrono::time_point<_Clock, _Duration>& __t,
372 _Predicate __pred)
373{
374 while (!__pred())
375 {
376 if (wait_until(__lk, __t) == cv_status::timeout)
377 return __pred();
378 }
379 return true;
380}
381
382template <class _Rep, class _Period>
383cv_status
384condition_variable::wait_for(unique_lock<mutex>& __lk,
385 const chrono::duration<_Rep, _Period>& __d)
386{
387 using namespace chrono;
Howard Hinnantcf115d22012-08-30 19:14:33388 if (__d <= __d.zero())
389 return cv_status::timeout;
390 typedef time_point<system_clock, duration<long double, nano> > __sys_tpf;
391 typedef time_point<system_clock, nanoseconds> __sys_tpi;
392 __sys_tpf _Max = __sys_tpi::max();
Howard Hinnantf8f85212010-11-20 19:16:30393 system_clock::time_point __s_now = system_clock::now();
394 steady_clock::time_point __c_now = steady_clock::now();
Howard Hinnantcf115d22012-08-30 19:14:33395 if (_Max - __d > __s_now)
396 __do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__d));
397 else
398 __do_timed_wait(__lk, __sys_tpi::max());
Howard Hinnantf8f85212010-11-20 19:16:30399 return steady_clock::now() - __c_now < __d ? cv_status::no_timeout :
400 cv_status::timeout;
Howard Hinnantbc8d3f92010-05-11 19:42:16401}
402
403template <class _Rep, class _Period, class _Predicate>
Evgeniy Stepanova3b25f82015-11-07 01:22:13404inline
Howard Hinnantbc8d3f92010-05-11 19:42:16405bool
406condition_variable::wait_for(unique_lock<mutex>& __lk,
407 const chrono::duration<_Rep, _Period>& __d,
408 _Predicate __pred)
409{
Howard Hinnantf8f85212010-11-20 19:16:30410 return wait_until(__lk, chrono::steady_clock::now() + __d,
Howard Hinnant0949eed2011-06-30 21:18:19411 _VSTD::move(__pred));
Howard Hinnantbc8d3f92010-05-11 19:42:16412}
413
Jonathan Roelofs8d86b2e2014-09-05 19:45:05414#endif // !_LIBCPP_HAS_NO_THREADS
415
Howard Hinnantbc8d3f92010-05-11 19:42:16416_LIBCPP_END_NAMESPACE_STD
417
418#endif // _LIBCPP___MUTEX_BASE