diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 18:01:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 18:01:01 +0000 |
| commit | b7332b04df5d50c92640c74cfeb138ecb7e3f7ae (patch) | |
| tree | b1b49faa0cab1482905e0cda6f0ee5d97e3fe08f /test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive | |
| parent | 6012fe9abb1f01b1b5b4ca908464804c21ff8602 (diff) | |
Notes
Diffstat (limited to 'test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive')
7 files changed, 0 insertions, 312 deletions
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/assign.fail.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/assign.fail.cpp deleted file mode 100644 index ae84be838d66..000000000000 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/assign.fail.cpp +++ /dev/null @@ -1,23 +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. -// -//===----------------------------------------------------------------------===// - -// <mutex> - -// class recursive_timed_mutex; - -// recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete; - -#include <mutex> - -int main() -{ - std::recursive_timed_mutex m0; - std::recursive_timed_mutex m1; - m1 = m0; -} diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/copy.fail.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/copy.fail.cpp deleted file mode 100644 index 487d6a8c269c..000000000000 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/copy.fail.cpp +++ /dev/null @@ -1,22 +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. -// -//===----------------------------------------------------------------------===// - -// <mutex> - -// class recursive_timed_mutex; - -// recursive_timed_mutex(const recursive_timed_mutex&) = delete; - -#include <mutex> - -int main() -{ - std::recursive_timed_mutex m0; - std::recursive_timed_mutex m1(m0); -} diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp deleted file mode 100644 index 56e1874dc126..000000000000 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/default.pass.cpp +++ /dev/null @@ -1,23 +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. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads - -// <mutex> - -// class recursive_timed_mutex; - -// recursive_timed_mutex(); - -#include <mutex> - -int main() -{ - std::recursive_timed_mutex m; -} diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp deleted file mode 100644 index 91f747bc1ab0..000000000000 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp +++ /dev/null @@ -1,52 +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. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads - -// <mutex> - -// class recursive_timed_mutex; - -// void lock(); - -#include <mutex> -#include <thread> -#include <cstdlib> -#include <cassert> - -#include <iostream> - -std::recursive_timed_mutex m; - -typedef std::chrono::system_clock Clock; -typedef Clock::time_point time_point; -typedef Clock::duration duration; -typedef std::chrono::milliseconds ms; -typedef std::chrono::nanoseconds ns; - -void f() -{ - time_point t0 = Clock::now(); - m.lock(); - time_point t1 = Clock::now(); - m.lock(); - m.unlock(); - m.unlock(); - ns d = t1 - t0 - ms(250); - assert(d < ms(50)); // within 50ms -} - -int main() -{ - m.lock(); - std::thread t(f); - std::this_thread::sleep_for(ms(250)); - m.unlock(); - t.join(); -} diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock.pass.cpp deleted file mode 100644 index 63c3cfee38a3..000000000000 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock.pass.cpp +++ /dev/null @@ -1,54 +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. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads - -// <mutex> - -// class recursive_timed_mutex; - -// bool try_lock(); - -#include <mutex> -#include <thread> -#include <cstdlib> -#include <cassert> - -std::recursive_timed_mutex m; - -typedef std::chrono::system_clock Clock; -typedef Clock::time_point time_point; -typedef Clock::duration duration; -typedef std::chrono::milliseconds ms; -typedef std::chrono::nanoseconds ns; - -void f() -{ - time_point t0 = Clock::now(); - assert(!m.try_lock()); - assert(!m.try_lock()); - assert(!m.try_lock()); - while(!m.try_lock()) - ; - time_point t1 = Clock::now(); - assert(m.try_lock()); - m.unlock(); - m.unlock(); - ns d = t1 - t0 - ms(250); - assert(d < ms(200)); // within 200ms -} - -int main() -{ - m.lock(); - std::thread t(f); - std::this_thread::sleep_for(ms(250)); - m.unlock(); - t.join(); -} diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp deleted file mode 100644 index 3c1d6ddc6f40..000000000000 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_for.pass.cpp +++ /dev/null @@ -1,69 +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. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads - -// <mutex> - -// class recursive_timed_mutex; - -// template <class Rep, class Period> -// bool try_lock_for(const chrono::duration<Rep, Period>& rel_time); - -#include <mutex> -#include <thread> -#include <cstdlib> -#include <cassert> - -std::recursive_timed_mutex m; - -typedef std::chrono::steady_clock Clock; -typedef Clock::time_point time_point; -typedef Clock::duration duration; -typedef std::chrono::milliseconds ms; -typedef std::chrono::nanoseconds ns; - -void f1() -{ - time_point t0 = Clock::now(); - assert(m.try_lock_for(ms(300)) == true); - time_point t1 = Clock::now(); - assert(m.try_lock()); - m.unlock(); - m.unlock(); - ns d = t1 - t0 - ms(250); - assert(d < ns(50000000)); // within 50ms -} - -void f2() -{ - time_point t0 = Clock::now(); - assert(m.try_lock_for(ms(250)) == false); - time_point t1 = Clock::now(); - ns d = t1 - t0 - ms(250); - assert(d < ns(50000000)); // within 50ms -} - -int main() -{ - { - m.lock(); - std::thread t(f1); - std::this_thread::sleep_for(ms(250)); - m.unlock(); - t.join(); - } - { - m.lock(); - std::thread t(f2); - std::this_thread::sleep_for(ms(300)); - m.unlock(); - t.join(); - } -} diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp deleted file mode 100644 index 066eb7b3064c..000000000000 --- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/try_lock_until.pass.cpp +++ /dev/null @@ -1,69 +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. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads - -// <mutex> - -// class recursive_timed_mutex; - -// template <class Clock, class Duration> -// bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time); - -#include <mutex> -#include <thread> -#include <cstdlib> -#include <cassert> - -std::recursive_timed_mutex m; - -typedef std::chrono::steady_clock Clock; -typedef Clock::time_point time_point; -typedef Clock::duration duration; -typedef std::chrono::milliseconds ms; -typedef std::chrono::nanoseconds ns; - -void f1() -{ - time_point t0 = Clock::now(); - assert(m.try_lock_until(Clock::now() + ms(300)) == true); - time_point t1 = Clock::now(); - assert(m.try_lock()); - m.unlock(); - m.unlock(); - ns d = t1 - t0 - ms(250); - assert(d < ms(50)); // within 50ms -} - -void f2() -{ - time_point t0 = Clock::now(); - assert(m.try_lock_until(Clock::now() + ms(250)) == false); - time_point t1 = Clock::now(); - ns d = t1 - t0 - ms(250); - assert(d < ms(50)); // within 50ms -} - -int main() -{ - { - m.lock(); - std::thread t(f1); - std::this_thread::sleep_for(ms(250)); - m.unlock(); - t.join(); - } - { - m.lock(); - std::thread t(f2); - std::this_thread::sleep_for(ms(300)); - m.unlock(); - t.join(); - } -} |
