diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-11-23 18:33:54 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-11-23 18:33:54 +0000 |
commit | e3120ed1bfc0b8163186732efce14f3b5d9ecf5f (patch) | |
tree | 637d49c4ef1453663d208b7131c94e0184ece0d0 /libcxx/test/thread/futures | |
parent | 60813f96e0d49bb525816802af245b1db12c4fed (diff) | |
download | bcm5719-llvm-e3120ed1bfc0b8163186732efce14f3b5d9ecf5f.tar.gz bcm5719-llvm-e3120ed1bfc0b8163186732efce14f3b5d9ecf5f.zip |
N3188 - Revision to N3113: Async Launch Policies (CH 36)
llvm-svn: 120027
Diffstat (limited to 'libcxx/test/thread/futures')
-rw-r--r-- | libcxx/test/thread/futures/futures.async/async.pass.cpp | 6 | ||||
-rw-r--r-- | libcxx/test/thread/futures/futures.overview/launch.pass.cpp | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libcxx/test/thread/futures/futures.async/async.pass.cpp b/libcxx/test/thread/futures/futures.async/async.pass.cpp index 16565e7e605..697eb089c62 100644 --- a/libcxx/test/thread/futures/futures.async/async.pass.cpp +++ b/libcxx/test/thread/futures/futures.async/async.pass.cpp @@ -82,7 +82,7 @@ int main() assert(t1-t0 < ms(100)); } { - std::future<int> f = std::async(std::launch::sync, f0); + std::future<int> f = std::async(std::launch::deferred, f0); std::this_thread::sleep_for(ms(300)); Clock::time_point t0 = Clock::now(); assert(f.get() == 3); @@ -115,7 +115,7 @@ int main() assert(t1-t0 < ms(100)); } { - std::future<int&> f = std::async(std::launch::sync, f1); + std::future<int&> f = std::async(std::launch::deferred, f1); std::this_thread::sleep_for(ms(300)); Clock::time_point t0 = Clock::now(); assert(&f.get() == &i); @@ -148,7 +148,7 @@ int main() assert(t1-t0 < ms(100)); } { - std::future<void> f = std::async(std::launch::sync, f2); + std::future<void> f = std::async(std::launch::deferred, f2); std::this_thread::sleep_for(ms(300)); Clock::time_point t0 = Clock::now(); f.get(); diff --git a/libcxx/test/thread/futures/futures.overview/launch.pass.cpp b/libcxx/test/thread/futures/futures.overview/launch.pass.cpp index 1e6a92fc23d..63eebe9f2d7 100644 --- a/libcxx/test/thread/futures/futures.overview/launch.pass.cpp +++ b/libcxx/test/thread/futures/futures.overview/launch.pass.cpp @@ -11,16 +11,16 @@ // enum class launch // { -// any, -// async, -// sync +// async = 1, +// deferred = 2, +// any = async | deferred // }; #include <future> int main() { - static_assert(std::launch::any == 0, ""); + static_assert(std::launch::any == std::launch::async | std::launch::deferred, ""); static_assert(std::launch::async == 1, ""); - static_assert(std::launch::sync == 2, ""); + static_assert(std::launch::deferred == 2, ""); } |