From ea907107107132d0201e0ba377408f4e117b581c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 22 Oct 2012 18:04:00 +0000 Subject: Vendor import of libc++ trunk r165949: http://llvm.org/svn/llvm-project/libcxx/trunk@165949 --- src/mutex.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/mutex.cpp') diff --git a/src/mutex.cpp b/src/mutex.cpp index 9aa051be37f2c..42195aa806487 100644 --- a/src/mutex.cpp +++ b/src/mutex.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#define _LIBCPP_BUILDING_MUTEX #include "mutex" #include "limits" #include "system_error" @@ -32,13 +33,13 @@ mutex::lock() } bool -mutex::try_lock() +mutex::try_lock() _NOEXCEPT { return pthread_mutex_trylock(&__m_) == 0; } void -mutex::unlock() +mutex::unlock() _NOEXCEPT { int ec = pthread_mutex_unlock(&__m_); assert(ec == 0); @@ -90,14 +91,14 @@ recursive_mutex::lock() } void -recursive_mutex::unlock() +recursive_mutex::unlock() _NOEXCEPT { int e = pthread_mutex_unlock(&__m_); assert(e == 0); } bool -recursive_mutex::try_lock() +recursive_mutex::try_lock() _NOEXCEPT { return pthread_mutex_trylock(&__m_) == 0; } @@ -124,7 +125,7 @@ timed_mutex::lock() } bool -timed_mutex::try_lock() +timed_mutex::try_lock() _NOEXCEPT { unique_lock lk(__m_, try_to_lock); if (lk.owns_lock() && !__locked_) @@ -136,7 +137,7 @@ timed_mutex::try_lock() } void -timed_mutex::unlock() +timed_mutex::unlock() _NOEXCEPT { lock_guard _(__m_); __locked_ = false; @@ -175,7 +176,7 @@ recursive_timed_mutex::lock() } bool -recursive_timed_mutex::try_lock() +recursive_timed_mutex::try_lock() _NOEXCEPT { pthread_t id = pthread_self(); unique_lock lk(__m_, try_to_lock); @@ -191,7 +192,7 @@ recursive_timed_mutex::try_lock() } void -recursive_timed_mutex::unlock() +recursive_timed_mutex::unlock() _NOEXCEPT { unique_lock lk(__m_); if (--__count_ == 0) -- cgit v1.2.3