summaryrefslogtreecommitdiffstats
path: root/libcxx/test/thread/thread.mutex/thread.mutex.requirements/thread.mutex.class/lock.pass.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-11-23 20:47:09 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-11-23 20:47:09 +0000
commitab7be6e43c878f4192cdac764677304757d95d71 (patch)
treee7ede4c2752e17ab5d2f27e7d2069a6f038d8aac /libcxx/test/thread/thread.mutex/thread.mutex.requirements/thread.mutex.class/lock.pass.cpp
parente57e9ef9b7012cadabea5705f7d65467cfd8d660 (diff)
downloadbcm5719-llvm-ab7be6e43c878f4192cdac764677304757d95d71.tar.gz
bcm5719-llvm-ab7be6e43c878f4192cdac764677304757d95d71.zip
Update testsuite strucuture to latest draft
llvm-svn: 120054
Diffstat (limited to 'libcxx/test/thread/thread.mutex/thread.mutex.requirements/thread.mutex.class/lock.pass.cpp')
-rw-r--r--libcxx/test/thread/thread.mutex/thread.mutex.requirements/thread.mutex.class/lock.pass.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/libcxx/test/thread/thread.mutex/thread.mutex.requirements/thread.mutex.class/lock.pass.cpp b/libcxx/test/thread/thread.mutex/thread.mutex.requirements/thread.mutex.class/lock.pass.cpp
deleted file mode 100644
index 222ebcb084e..00000000000
--- a/libcxx/test/thread/thread.mutex/thread.mutex.requirements/thread.mutex.class/lock.pass.cpp
+++ /dev/null
@@ -1,48 +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 mutex;
-
-// void lock();
-
-#include <mutex>
-#include <thread>
-#include <cstdlib>
-#include <cassert>
-
-#include <iostream>
-
-std::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.unlock();
- ns d = t1 - t0 - ms(250);
- assert(d < ns(2500000)); // within 2.5ms
-}
-
-int main()
-{
- m.lock();
- std::thread t(f);
- std::this_thread::sleep_for(ms(250));
- m.unlock();
- t.join();
-}
OpenPOWER on IntegriCloud