Implement N3891: A proposal to rename shared_mutex to shared_timed_mutex
This is as straightforward as it sounds, a renamed from shared_mutex to
shared_timed_mutex.
Note that libcxx .dylib and .so files built with c++14 support need to
be rebuilt.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204078 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/shared_mutex b/include/shared_mutex
index 5b1f53a..7661054 100644
--- a/include/shared_mutex
+++ b/include/shared_mutex
@@ -19,14 +19,14 @@
namespace std
{
-class shared_mutex
+class shared_timed_mutex
{
public:
- shared_mutex();
- ~shared_mutex();
+ shared_timed_mutex();
+ ~shared_timed_mutex();
- shared_mutex(const shared_mutex&) = delete;
- shared_mutex& operator=(const shared_mutex&) = delete;
+ shared_timed_mutex(const shared_timed_mutex&) = delete;
+ shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
// Exclusive ownership
void lock(); // blocking
@@ -114,7 +114,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_TYPE_VIS shared_mutex
+class _LIBCPP_TYPE_VIS shared_timed_mutex
{
mutex __mut_;
condition_variable __gate1_;
@@ -124,11 +124,11 @@
static const unsigned __write_entered_ = 1U << (sizeof(unsigned)*__CHAR_BIT__ - 1);
static const unsigned __n_readers_ = ~__write_entered_;
public:
- shared_mutex();
- _LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default;
+ shared_timed_mutex();
+ _LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default;
- shared_mutex(const shared_mutex&) = delete;
- shared_mutex& operator=(const shared_mutex&) = delete;
+ shared_timed_mutex(const shared_timed_mutex&) = delete;
+ shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
// Exclusive ownership
void lock();
@@ -163,7 +163,7 @@
template <class _Clock, class _Duration>
bool
-shared_mutex::try_lock_until(
+shared_timed_mutex::try_lock_until(
const chrono::time_point<_Clock, _Duration>& __abs_time)
{
unique_lock<mutex> __lk(__mut_);
@@ -198,7 +198,7 @@
template <class _Clock, class _Duration>
bool
-shared_mutex::try_lock_shared_until(
+shared_timed_mutex::try_lock_shared_until(
const chrono::time_point<_Clock, _Duration>& __abs_time)
{
unique_lock<mutex> __lk(__mut_);
diff --git a/src/shared_mutex.cpp b/src/shared_mutex.cpp
index 5fb22e4..dd78a16 100644
--- a/src/shared_mutex.cpp
+++ b/src/shared_mutex.cpp
@@ -12,7 +12,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-shared_mutex::shared_mutex()
+shared_timed_mutex::shared_timed_mutex()
: __state_(0)
{
}
@@ -20,7 +20,7 @@
// Exclusive ownership
void
-shared_mutex::lock()
+shared_timed_mutex::lock()
{
unique_lock<mutex> lk(__mut_);
while (__state_ & __write_entered_)
@@ -31,7 +31,7 @@
}
bool
-shared_mutex::try_lock()
+shared_timed_mutex::try_lock()
{
unique_lock<mutex> lk(__mut_);
if (__state_ == 0)
@@ -43,7 +43,7 @@
}
void
-shared_mutex::unlock()
+shared_timed_mutex::unlock()
{
lock_guard<mutex> _(__mut_);
__state_ = 0;
@@ -53,7 +53,7 @@
// Shared ownership
void
-shared_mutex::lock_shared()
+shared_timed_mutex::lock_shared()
{
unique_lock<mutex> lk(__mut_);
while ((__state_ & __write_entered_) || (__state_ & __n_readers_) == __n_readers_)
@@ -64,7 +64,7 @@
}
bool
-shared_mutex::try_lock_shared()
+shared_timed_mutex::try_lock_shared()
{
unique_lock<mutex> lk(__mut_);
unsigned num_readers = __state_ & __n_readers_;
@@ -79,7 +79,7 @@
}
void
-shared_mutex::unlock_shared()
+shared_timed_mutex::unlock_shared()
{
lock_guard<mutex> _(__mut_);
unsigned num_readers = (__state_ & __n_readers_) - 1;
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_assign.fail.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_assign.fail.cpp
index 0bd347d..446807f 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_assign.fail.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_assign.fail.cpp
@@ -17,16 +17,16 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m0;
-std::shared_mutex m1;
+std::shared_timed_mutex m0;
+std::shared_timed_mutex m1;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> lk0(m0);
- std::shared_lock<std::shared_mutex> lk1(m1);
+ std::shared_lock<std::shared_timed_mutex> lk0(m0);
+ std::shared_lock<std::shared_timed_mutex> lk1(m1);
lk1 = lk0;
#else
# error
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_ctor.fail.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_ctor.fail.cpp
index 66cec9e..370c1fa 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_ctor.fail.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/copy_ctor.fail.cpp
@@ -16,14 +16,14 @@
#include <shared_mutex>
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> lk0(m);
- std::shared_lock<std::shared_mutex> lk = lk0;
+ std::shared_lock<std::shared_timed_mutex> lk0(m);
+ std::shared_lock<std::shared_timed_mutex> lk = lk0;
#else
# error
#endif // _LIBCPP_STD_VER > 11
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
index 2adef5f..2713680 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
@@ -19,7 +19,7 @@
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> ul;
+ std::shared_lock<std::shared_timed_mutex> ul;
assert(!ul.owns_lock());
assert(ul.mutex() == nullptr);
#endif // _LIBCPP_STD_VER > 11
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
index 1fcc98f..73936b7 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
@@ -18,16 +18,16 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m0;
-std::shared_mutex m1;
+std::shared_timed_mutex m0;
+std::shared_timed_mutex m1;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> lk0(m0);
- std::shared_lock<std::shared_mutex> lk1(m1);
+ std::shared_lock<std::shared_timed_mutex> lk0(m0);
+ std::shared_lock<std::shared_timed_mutex> lk1(m1);
lk1 = std::move(lk0);
assert(lk1.mutex() == &m0);
assert(lk1.owns_lock() == true);
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
index 7e801da..cf63861 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp
@@ -17,14 +17,14 @@
#include <cassert>
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> lk0(m);
- std::shared_lock<std::shared_mutex> lk = std::move(lk0);
+ std::shared_lock<std::shared_timed_mutex> lk0(m);
+ std::shared_lock<std::shared_timed_mutex> lk = std::move(lk0);
assert(lk.mutex() == &m);
assert(lk.owns_lock() == true);
assert(lk0.mutex() == nullptr);
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
index fd1dad4..01bfbfd 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
@@ -21,7 +21,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
@@ -34,7 +34,7 @@
time_point t0 = Clock::now();
time_point t1;
{
- std::shared_lock<std::shared_mutex> ul(m);
+ std::shared_lock<std::shared_timed_mutex> ul(m);
t1 = Clock::now();
}
ns d = t1 - t0 - ms(250);
@@ -46,7 +46,7 @@
time_point t0 = Clock::now();
time_point t1;
{
- std::shared_lock<std::shared_mutex> ul(m);
+ std::shared_lock<std::shared_timed_mutex> ul(m);
t1 = Clock::now();
}
ns d = t1 - t0;
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
index 9c44005..b4f6025 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
@@ -19,9 +19,9 @@
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_mutex m;
+ std::shared_timed_mutex m;
m.lock();
- std::shared_lock<std::shared_mutex> lk(m, std::adopt_lock);
+ std::shared_lock<std::shared_timed_mutex> lk(m, std::adopt_lock);
assert(lk.mutex() == &m);
assert(lk.owns_lock() == true);
#endif // _LIBCPP_STD_VER > 11
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
index 2f2247a..3a8b61a 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
@@ -19,8 +19,8 @@
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_mutex m;
- std::shared_lock<std::shared_mutex> lk(m, std::defer_lock);
+ std::shared_timed_mutex m;
+ std::shared_lock<std::shared_timed_mutex> lk(m, std::defer_lock);
assert(lk.mutex() == &m);
assert(lk.owns_lock() == false);
#endif // _LIBCPP_STD_VER > 11
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
index f3798af..ffe329c 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp
@@ -22,7 +22,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
@@ -33,7 +33,7 @@
void f1()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_mutex> lk(m, ms(300));
+ std::shared_lock<std::shared_timed_mutex> lk(m, ms(300));
assert(lk.owns_lock() == true);
time_point t1 = Clock::now();
ns d = t1 - t0 - ms(250);
@@ -43,7 +43,7 @@
void f2()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_mutex> lk(m, ms(250));
+ std::shared_lock<std::shared_timed_mutex> lk(m, ms(250));
assert(lk.owns_lock() == false);
time_point t1 = Clock::now();
ns d = t1 - t0 - ms(250);
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
index 44eaee2..baf08de 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// template <class Clock, class Duration>
// shared_lock(mutex_type& m, const chrono::time_point<Clock, Duration>& abs_time);
@@ -22,7 +22,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
@@ -33,7 +33,7 @@
void f1()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_mutex> lk(m, Clock::now() + ms(300));
+ std::shared_lock<std::shared_timed_mutex> lk(m, Clock::now() + ms(300));
assert(lk.owns_lock() == true);
time_point t1 = Clock::now();
ns d = t1 - t0 - ms(250);
@@ -43,7 +43,7 @@
void f2()
{
time_point t0 = Clock::now();
- std::shared_lock<std::shared_mutex> lk(m, Clock::now() + ms(250));
+ std::shared_lock<std::shared_timed_mutex> lk(m, Clock::now() + ms(250));
assert(lk.owns_lock() == false);
time_point t1 = Clock::now();
ns d = t1 - t0 - ms(250);
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
index 9dae3f9..9d06d3f 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp
@@ -21,7 +21,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
@@ -33,20 +33,20 @@
{
time_point t0 = Clock::now();
{
- std::shared_lock<std::shared_mutex> lk(m, std::try_to_lock);
+ std::shared_lock<std::shared_timed_mutex> lk(m, std::try_to_lock);
assert(lk.owns_lock() == false);
}
{
- std::shared_lock<std::shared_mutex> lk(m, std::try_to_lock);
+ std::shared_lock<std::shared_timed_mutex> lk(m, std::try_to_lock);
assert(lk.owns_lock() == false);
}
{
- std::shared_lock<std::shared_mutex> lk(m, std::try_to_lock);
+ std::shared_lock<std::shared_timed_mutex> lk(m, std::try_to_lock);
assert(lk.owns_lock() == false);
}
while (true)
{
- std::shared_lock<std::shared_mutex> lk(m, std::try_to_lock);
+ std::shared_lock<std::shared_timed_mutex> lk(m, std::try_to_lock);
if (lk.owns_lock())
break;
}
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
index c6617a5..ecac479 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
@@ -21,7 +21,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
@@ -31,7 +31,7 @@
void f()
{
- std::shared_lock<std::shared_mutex> lk(m, std::defer_lock);
+ std::shared_lock<std::shared_timed_mutex> lk(m, std::defer_lock);
time_point t0 = Clock::now();
lk.lock();
time_point t1 = Clock::now();
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
index 927e9d1..4b4f6c6 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp
@@ -18,16 +18,16 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> lk0;
+ std::shared_lock<std::shared_timed_mutex> lk0;
assert(lk0.mutex() == nullptr);
- std::shared_lock<std::shared_mutex> lk1(m);
+ std::shared_lock<std::shared_timed_mutex> lk1(m);
assert(lk1.mutex() == &m);
lk1.unlock();
assert(lk1.mutex() == &m);
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
index 901ccbc..177a69e 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
@@ -18,16 +18,16 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> lk0;
+ std::shared_lock<std::shared_timed_mutex> lk0;
assert(static_cast<bool>(lk0) == false);
- std::shared_lock<std::shared_mutex> lk1(m);
+ std::shared_lock<std::shared_timed_mutex> lk1(m);
assert(static_cast<bool>(lk1) == true);
lk1.unlock();
assert(static_cast<bool>(lk1) == false);
diff --git a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
index ca4715b..a10c588 100644
--- a/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
+++ b/test/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp
@@ -18,16 +18,16 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_lock<std::shared_mutex> lk0;
+ std::shared_lock<std::shared_timed_mutex> lk0;
assert(lk0.owns_lock() == false);
- std::shared_lock<std::shared_mutex> lk1(m);
+ std::shared_lock<std::shared_timed_mutex> lk1(m);
assert(lk1.owns_lock() == true);
lk1.unlock();
assert(lk1.owns_lock() == false);
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/copy.fail.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/copy.fail.cpp
deleted file mode 100644
index 7e69923..0000000
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/copy.fail.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <shared_mutex>
-
-// class shared_mutex;
-
-// shared_mutex(const shared_mutex&) = delete;
-
-#include <shared_mutex>
-
-int main()
-{
-#if _LIBCPP_STD_VER > 11
- std::shared_mutex m0;
- std::shared_mutex m1(m0);
-#else
-# error
-#endif
-}
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/nothing_to_do.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/nothing_to_do.pass.cpp
similarity index 100%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/nothing_to_do.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/nothing_to_do.pass.cpp
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/assign.fail.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/assign.fail.cpp
similarity index 74%
copy from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/assign.fail.cpp
copy to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/assign.fail.cpp
index 1405a22..528aaca 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/assign.fail.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/assign.fail.cpp
@@ -9,17 +9,17 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
-// shared_mutex& operator=(const shared_mutex&) = delete;
+// shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
#include <shared_mutex>
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_mutex m0;
- std::shared_mutex m1;
+ std::shared_timed_mutex m0;
+ std::shared_timed_mutex m1;
m1 = m0;
#else
# error
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/assign.fail.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/copy.fail.cpp
similarity index 74%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/assign.fail.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/copy.fail.cpp
index 1405a22..dbf0100 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/assign.fail.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/copy.fail.cpp
@@ -9,18 +9,17 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
-// shared_mutex& operator=(const shared_mutex&) = delete;
+// shared_timed_mutex(const shared_timed_mutex&) = delete;
#include <shared_mutex>
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_mutex m0;
- std::shared_mutex m1;
- m1 = m0;
+ std::shared_timed_mutex m0;
+ std::shared_timed_mutex m1(m0);
#else
# error
#endif
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/default.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
similarity index 83%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/default.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
index 060fb92..f45382d 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/default.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/default.pass.cpp
@@ -9,15 +9,15 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
-// shared_mutex();
+// shared_timed_mutex();
#include <shared_mutex>
int main()
{
#if _LIBCPP_STD_VER > 11
- std::shared_mutex m;
+ std::shared_timed_mutex m;
#endif
}
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/lock.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
similarity index 94%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/lock.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
index 2fd7800..153ce62 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/lock.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// void lock();
@@ -20,7 +20,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/lock_shared.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
similarity index 96%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/lock_shared.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
index 6fe1b44..724a7b0 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/lock_shared.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/lock_shared.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// void lock_shared();
@@ -21,7 +21,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp
similarity index 95%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp
index 86aa0c4..aa6f5fb 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// bool try_lock();
@@ -20,7 +20,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_for.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
similarity index 96%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_for.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
index 1560359..e97b313 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_for.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// template <class Rep, class Period>
// bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
@@ -21,7 +21,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
similarity index 95%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
index da859ab..a34633e 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// bool try_lock_shared();
@@ -21,7 +21,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared_for.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
similarity index 96%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared_for.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
index b1d6e4c..528c69a 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared_for.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// template <class Rep, class Period>
// bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time);
@@ -22,7 +22,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared_until.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
similarity index 96%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared_until.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
index 3dbf0c7..a6238e3 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_shared_until.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_until.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// template <class Clock, class Duration>
// bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time);
@@ -22,7 +22,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
diff --git a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_until.pass.cpp b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
similarity index 96%
rename from test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_until.pass.cpp
rename to test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
index 44f91f0..8670fbf 100644
--- a/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedmutex.requirements/thread.sharedmutex.class/try_lock_until.pass.cpp
+++ b/test/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp
@@ -9,7 +9,7 @@
// <shared_mutex>
-// class shared_mutex;
+// class shared_timed_mutex;
// template <class Clock, class Duration>
// bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
@@ -21,7 +21,7 @@
#if _LIBCPP_STD_VER > 11
-std::shared_mutex m;
+std::shared_timed_mutex m;
typedef std::chrono::steady_clock Clock;
typedef Clock::time_point time_point;
diff --git a/www/cxx1y_status.html b/www/cxx1y_status.html
index dbdeedd..5516e34 100644
--- a/www/cxx1y_status.html
+++ b/www/cxx1y_status.html
@@ -101,7 +101,7 @@
<tr><td><a href="http://isocpp.org/files/papers/N3924.pdf">3924</a></td><td>LWG</td><td>Discouraging rand() in C++14</td><td>Issaquah</td><td>Complete</td><td>3.5</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3887">3887</a></td><td>LWG</td><td>Consistent Metafunction Aliases</td><td>Issaquah</td><td>Complete</td><td>3.5</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3891">3891</a></td><td>SG1</td><td>A proposal to rename shared_mutex to shared_timed_mutex</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3891">3891</a></td><td>SG1</td><td>A proposal to rename shared_mutex to shared_timed_mutex</td><td>Issaquah</td><td>Complete</td><td>3.5</td></tr>
<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
</table>