summaryrefslogtreecommitdiff
path: root/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp')
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
index 6ce33761068f..cb5c55925eef 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// <mutex>
@@ -21,6 +20,8 @@
#include <cstdlib>
#include <cassert>
+#include "test_macros.h"
+
std::mutex m;
typedef std::chrono::system_clock Clock;
@@ -38,6 +39,7 @@ void f()
assert(lk.owns_lock() == true);
ns d = t1 - t0 - ms(250);
assert(d < ms(25)); // within 25ms
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.lock();
@@ -47,8 +49,10 @@ void f()
{
assert(e.code().value() == EDEADLK);
}
+#endif
lk.unlock();
lk.release();
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
lk.lock();
@@ -58,6 +62,7 @@ void f()
{
assert(e.code().value() == EPERM);
}
+#endif
}
int main()