diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-02-17 14:29:14 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-03-25 00:34:11 +0700 |
commit | 59ff5a6a3c3e1f5255c5cf29f98df633a77b89b3 (patch) | |
tree | c7660fa62600366e3479dbf6b2fd1d25709af1b5 /system/lib/libcxx/mutex.cpp | |
parent | 80fd6f0bce2b95db6ec539c9275ce24585550e7c (diff) |
Update to current libcxx.
This doesn't work yet as it needs to be customized for use with
emscripten still.
Diffstat (limited to 'system/lib/libcxx/mutex.cpp')
-rw-r--r-- | system/lib/libcxx/mutex.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/system/lib/libcxx/mutex.cpp b/system/lib/libcxx/mutex.cpp index 16817198..42195aa8 100644 --- a/system/lib/libcxx/mutex.cpp +++ b/system/lib/libcxx/mutex.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#define _LIBCPP_BUILDING_MUTEX #include "mutex" #include "limits" #include "system_error" @@ -20,8 +21,7 @@ const adopt_lock_t adopt_lock = {}; mutex::~mutex() { - int e = pthread_mutex_destroy(&__m_); -// assert(e == 0); + pthread_mutex_destroy(&__m_); } void @@ -33,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); @@ -91,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; } @@ -125,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_) @@ -137,7 +137,7 @@ timed_mutex::try_lock() } void -timed_mutex::unlock() +timed_mutex::unlock() _NOEXCEPT { lock_guard<mutex> _(__m_); __locked_ = false; @@ -176,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); @@ -192,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) |