From 083c980732b44eb899ce399cf182dec9b90b9a1d Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 7 Jan 2015 21:08:01 +0000 Subject: Vendor import of libc++ trunk r224926: https://llvm.org/svn/llvm-project/libcxx/trunk@224926 --- src/algorithm.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/algorithm.cpp') diff --git a/src/algorithm.cpp b/src/algorithm.cpp index 10c4c331..e548856 100644 --- a/src/algorithm.cpp +++ b/src/algorithm.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; #include "algorithm" #include "random" #include "mutex" @@ -48,12 +47,16 @@ template bool __insertion_sort_incomplete<__less&, long double*>(lo template unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&); +#ifndef _LIBCPP_HAS_NO_THREADS static pthread_mutex_t __rs_mut = PTHREAD_MUTEX_INITIALIZER; +#endif unsigned __rs_default::__c_ = 0; __rs_default::__rs_default() { +#ifndef _LIBCPP_HAS_NO_THREADS pthread_mutex_lock(&__rs_mut); +#endif __c_ = 1; } @@ -64,8 +67,12 @@ __rs_default::__rs_default(const __rs_default&) __rs_default::~__rs_default() { +#ifndef _LIBCPP_HAS_NO_THREADS if (--__c_ == 0) pthread_mutex_unlock(&__rs_mut); +#else + --__c_; +#endif } __rs_default::result_type -- cgit v1.1