summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/mutex
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2012-03-14 00:09:36 +0000
committertheraven <theraven@FreeBSD.org>2012-03-14 00:09:36 +0000
commit7bd22d0949674b61e2c1a97cbb6caeeb5ab7fd19 (patch)
tree077f044b08d256dd8348f977fe56d18c08fccd78 /contrib/libc++/include/mutex
parentd83b894ff4280333de5ef40496cfd061b515ba54 (diff)
parentbaa75b9984d33ea49ffb76a73507b64d879166cc (diff)
downloadFreeBSD-src-7bd22d0949674b61e2c1a97cbb6caeeb5ab7fd19.zip
FreeBSD-src-7bd22d0949674b61e2c1a97cbb6caeeb5ab7fd19.tar.gz
Import new versions of libcxxrt and libc++.
Please tests any C++ code you care about with -stdlib=libc++! Approved by: dim (mentor)
Diffstat (limited to 'contrib/libc++/include/mutex')
-rw-r--r--contrib/libc++/include/mutex32
1 files changed, 17 insertions, 15 deletions
diff --git a/contrib/libc++/include/mutex b/contrib/libc++/include/mutex
index 37e74d6..62b733f 100644
--- a/contrib/libc++/include/mutex
+++ b/contrib/libc++/include/mutex
@@ -179,6 +179,8 @@ template<class Callable, class ...Args>
#include <tuple>
#endif
+#include <__undef_min_max>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -462,23 +464,23 @@ private:
#ifndef _LIBCPP_HAS_NO_VARIADICS
-template <class _F>
+template <class _Fp>
class __call_once_param
{
- _F __f_;
+ _Fp __f_;
public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
- explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
+ explicit __call_once_param(_Fp&& __f) : __f_(_VSTD::move(__f)) {}
#else
_LIBCPP_INLINE_VISIBILITY
- explicit __call_once_param(const _F& __f) : __f_(__f) {}
+ explicit __call_once_param(const _Fp& __f) : __f_(__f) {}
#endif
_LIBCPP_INLINE_VISIBILITY
void operator()()
{
- typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index;
+ typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
__execute(_Index());
}
@@ -493,17 +495,17 @@ private:
#else
-template <class _F>
+template <class _Fp>
class __call_once_param
{
- _F __f_;
+ _Fp __f_;
public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
- explicit __call_once_param(_F&& __f) : __f_(_VSTD::move(__f)) {}
+ explicit __call_once_param(_Fp&& __f) : __f_(_VSTD::move(__f)) {}
#else
_LIBCPP_INLINE_VISIBILITY
- explicit __call_once_param(const _F& __f) : __f_(__f) {}
+ explicit __call_once_param(const _Fp& __f) : __f_(__f) {}
#endif
_LIBCPP_INLINE_VISIBILITY
@@ -515,11 +517,11 @@ public:
#endif
-template <class _F>
+template <class _Fp>
void
__call_once_proxy(void* __vp)
{
- __call_once_param<_F>* __p = static_cast<__call_once_param<_F>*>(__vp);
+ __call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp);
(*__p)();
}
@@ -532,12 +534,12 @@ inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
{
- if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
+ if (__flag.__state_ != ~0ul)
{
- typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G;
- __call_once_param<_G> __p(_G(__decay_copy(_VSTD::forward<_Callable>(__func)),
+ typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _Gp;
+ __call_once_param<_Gp> __p(_Gp(__decay_copy(_VSTD::forward<_Callable>(__func)),
__decay_copy(_VSTD::forward<_Args>(__args))...));
- __call_once(__flag.__state_, &__p, &__call_once_proxy<_G>);
+ __call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>);
}
}
OpenPOWER on IntegriCloud