summaryrefslogtreecommitdiff
path: root/src/mutex.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
commit0dc0969cd0a732760f0aa79942a04e0eaef297c4 (patch)
tree051bdb57b1ac6ee143f61ddbb47bd0da619f6f0c /src/mutex.cpp
parent868847c6900e575417c03bced6e562b3af891318 (diff)
Notes
Diffstat (limited to 'src/mutex.cpp')
-rw-r--r--src/mutex.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mutex.cpp b/src/mutex.cpp
index 9397ae73ca4f..b858e8877ae5 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -11,7 +11,6 @@
#include "mutex"
#include "limits"
#include "system_error"
-#include "cassert"
#include "include/atomic_support.h"
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -37,7 +36,7 @@ mutex::lock()
bool
mutex::try_lock() _NOEXCEPT
{
- return __libcpp_mutex_trylock(&__m_) == 0;
+ return __libcpp_mutex_trylock(&__m_);
}
void
@@ -45,7 +44,7 @@ mutex::unlock() _NOEXCEPT
{
int ec = __libcpp_mutex_unlock(&__m_);
(void)ec;
- assert(ec == 0);
+ _LIBCPP_ASSERT(ec == 0, "call to mutex::unlock failed");
}
// recursive_mutex
@@ -61,7 +60,7 @@ recursive_mutex::~recursive_mutex()
{
int e = __libcpp_recursive_mutex_destroy(&__m_);
(void)e;
- assert(e == 0);
+ _LIBCPP_ASSERT(e == 0, "call to ~recursive_mutex() failed");
}
void
@@ -77,13 +76,13 @@ recursive_mutex::unlock() _NOEXCEPT
{
int e = __libcpp_recursive_mutex_unlock(&__m_);
(void)e;
- assert(e == 0);
+ _LIBCPP_ASSERT(e == 0, "call to recursive_mutex::unlock() failed");
}
bool
recursive_mutex::try_lock() _NOEXCEPT
{
- return __libcpp_recursive_mutex_trylock(&__m_) == 0;
+ return __libcpp_recursive_mutex_trylock(&__m_);
}
// timed_mutex