diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h --- a/llvm/include/llvm/Support/ThreadPool.h +++ b/llvm/include/llvm/Support/ThreadPool.h @@ -56,8 +56,7 @@ /// Asynchronous submission of a task to the pool. The returned future can be /// used to wait for the task to finish and is *non-blocking* on destruction. - template - auto async(Func &&F) -> std::shared_future { + template auto async(Func &&F) -> std::future { return asyncImpl(std::function(std::forward(F))); } @@ -101,7 +100,7 @@ /// Asynchronous submission of a task to the pool. The returned future can be /// used to wait for the task to finish and is *non-blocking* on destruction. template - std::shared_future asyncImpl(std::function Task) { + std::future asyncImpl(std::function Task) { #if LLVM_ENABLE_THREADS /// Wrap the Task in a std::function that sets the result of the @@ -117,12 +116,12 @@ Tasks.push(std::move(R.first)); } QueueCondition.notify_one(); - return R.second.share(); + return std::move(R.second); #else // LLVM_ENABLE_THREADS Disabled // Get a Future with launch::deferred execution using std::async - auto Future = std::async(std::launch::deferred, std::move(Task)).share(); + auto Future = std::async(std::launch::deferred, std::move(Task)); // Wrap the future so that both ThreadPool::wait() can operate and the // returned future can be sync'ed on. Tasks.push([Future]() { Future.get(); }); diff --git a/llvm/tools/llvm-reduce/deltas/Delta.cpp b/llvm/tools/llvm-reduce/deltas/Delta.cpp --- a/llvm/tools/llvm-reduce/deltas/Delta.cpp +++ b/llvm/tools/llvm-reduce/deltas/Delta.cpp @@ -267,7 +267,7 @@ WriteBitcodeToFile(*Test.getProgram().M, BCOS); } - std::deque>> TaskQueue; + std::deque>> TaskQueue; for (auto I = ChunksStillConsideredInteresting.rbegin(), E = ChunksStillConsideredInteresting.rend(); I != E; ++I) {