diff options
author | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-05-06 14:06:29 +0000 |
---|---|---|
committer | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-05-06 14:06:29 +0000 |
commit | c7e4239fabf2c876449697caf05a342b01bf0312 (patch) | |
tree | 9647e2a0dd535ba2c7d71b188db257a39a1956ea /libcxx/src/algorithm.cpp | |
parent | a463d31a64833c24962a38aca79f4d2e12b7f4d0 (diff) | |
download | llvm-c7e4239fabf2c876449697caf05a342b01bf0312.tar.gz |
Refactor pthread usage of libcxx.
This patch extracts out all the pthread dependencies of libcxx into the
new header __threading_support. The motivation is to make it easy to
re-target libcxx into platforms that do not support pthread.
Original patch from Fulvio Esposito (fulvio.esposito@outlook.com) - D11781
Applied with tweaks - D19412
Change-Id: I301111f0075de93dd8129416e06babc195aa936b
llvm-svn: 268734
Diffstat (limited to 'libcxx/src/algorithm.cpp')
-rw-r--r-- | libcxx/src/algorithm.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/src/algorithm.cpp b/libcxx/src/algorithm.cpp index e548856ff6e1..e9752b0653e0 100644 --- a/libcxx/src/algorithm.cpp +++ b/libcxx/src/algorithm.cpp @@ -48,14 +48,14 @@ template bool __insertion_sort_incomplete<__less<long double>&, long double*>(lo template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&); #ifndef _LIBCPP_HAS_NO_THREADS -static pthread_mutex_t __rs_mut = PTHREAD_MUTEX_INITIALIZER; +static __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER; #endif unsigned __rs_default::__c_ = 0; __rs_default::__rs_default() { #ifndef _LIBCPP_HAS_NO_THREADS - pthread_mutex_lock(&__rs_mut); + __libcpp_mutex_lock(&__rs_mut); #endif __c_ = 1; } @@ -69,7 +69,7 @@ __rs_default::~__rs_default() { #ifndef _LIBCPP_HAS_NO_THREADS if (--__c_ == 0) - pthread_mutex_unlock(&__rs_mut); + __libcpp_mutex_unlock(&__rs_mut); #else --__c_; #endif |