diff options
author | Zachary Turner <zturner@google.com> | 2018-06-13 21:24:19 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-06-13 21:24:19 +0000 |
commit | 9b8b0794b8dd8ebdd17b3653ad29abcc6b7a3583 (patch) | |
tree | d6094f4278eaefe72b341aca015c3b9ba185dec0 /llvm/unittests/Support/ThreadPool.cpp | |
parent | 03185797d73e2c28ae37195ea24a4f0a7e290914 (diff) | |
download | bcm5719-llvm-9b8b0794b8dd8ebdd17b3653ad29abcc6b7a3583.tar.gz bcm5719-llvm-9b8b0794b8dd8ebdd17b3653ad29abcc6b7a3583.zip |
Revert "Enable ThreadPool to queue tasks that return values."
This is failing to compile when LLVM_ENABLE_THREADS is false,
and the fix is not immediately obvious, so reverting while I look
into it.
llvm-svn: 334658
Diffstat (limited to 'llvm/unittests/Support/ThreadPool.cpp')
-rw-r--r-- | llvm/unittests/Support/ThreadPool.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp index d2d50c3764e..0da33ad50c0 100644 --- a/llvm/unittests/Support/ThreadPool.cpp +++ b/llvm/unittests/Support/ThreadPool.cpp @@ -147,25 +147,6 @@ TEST_F(ThreadPoolTest, GetFuture) { ASSERT_EQ(2, i.load()); } -TEST_F(ThreadPoolTest, TaskWithResult) { - CHECK_UNSUPPORTED(); - // By making only 1 thread in the pool the two tasks are serialized with - // respect to each other, which means that the second one must return 2. - ThreadPool Pool{1}; - std::atomic_int i{0}; - Pool.async([this, &i] { - waitForMainThread(); - ++i; - }); - // Force the future using get() - std::shared_future<int> Future = Pool.async([&i] { return ++i; }); - ASSERT_EQ(0, i.load()); - setMainThreadReady(); - int Result = Future.get(); - ASSERT_EQ(2, i.load()); - ASSERT_EQ(2, Result); -} - TEST_F(ThreadPoolTest, PoolDestruction) { CHECK_UNSUPPORTED(); // Test that we are waiting on destruction |