diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2012-07-21 16:13:09 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2012-07-21 16:13:09 +0000 |
| commit | 02e610ef3440301bf8f13ce43238306b6eaf7d53 (patch) | |
| tree | d8da1e4bd968d2dc75127bcb01d6ac5b819550ee /libcxx/src | |
| parent | 9669c198ba7d66d95c6e7edf66c275335d4d27d6 (diff) | |
| download | bcm5719-llvm-02e610ef3440301bf8f13ce43238306b6eaf7d53.tar.gz bcm5719-llvm-02e610ef3440301bf8f13ce43238306b6eaf7d53.zip | |
noexcept and constexpr applied to <mutex>.
llvm-svn: 160604
Diffstat (limited to 'libcxx/src')
| -rw-r--r-- | libcxx/src/mutex.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libcxx/src/mutex.cpp b/libcxx/src/mutex.cpp index 9aa051be37f..42195aa8064 100644 --- a/libcxx/src/mutex.cpp +++ b/libcxx/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<mutex> 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<mutex> _(__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<mutex> 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<mutex> lk(__m_); if (--__count_ == 0) |

