summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Support/ThreadPool.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Support/ThreadPool.h')
-rw-r--r--llvm/include/llvm/Support/ThreadPool.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h
index 665cec2465b..9e948a0e9ee 100644
--- a/llvm/include/llvm/Support/ThreadPool.h
+++ b/llvm/include/llvm/Support/ThreadPool.h
@@ -75,29 +75,26 @@ public:
/// 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 <typename Function, typename... Args>
- inline std::shared_future<VoidTy> async(Function &&F, Args &&... ArgList) {
+ inline void async(Function &&F, Args &&... ArgList) {
auto Task =
std::bind(std::forward<Function>(F), std::forward<Args>(ArgList)...);
#ifndef _MSC_VER
- return asyncImpl(std::move(Task));
+ asyncImpl(std::move(Task));
#else
// This lambda has to be marked mutable because MSVC 2013's std::bind call
// operator isn't const qualified.
- return asyncImpl([Task](VoidTy) mutable -> VoidTy {
- Task();
- return VoidTy();
- });
+ asyncImpl([Task](VoidTy) mutable { Task(); });
#endif
}
/// 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 <typename Function>
- inline std::shared_future<VoidTy> async(Function &&F) {
+ inline void async(Function &&F) {
#ifndef _MSC_VER
- return asyncImpl(std::forward<Function>(F));
+ asyncImpl(std::forward<Function>(F));
#else
- return asyncImpl([F] (VoidTy) -> VoidTy { F(); return VoidTy(); });
+ asyncImpl([F] (VoidTy) { F(); });
#endif
}
@@ -106,9 +103,8 @@ public:
void wait();
private:
- /// 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.
- std::shared_future<VoidTy> asyncImpl(TaskTy F);
+ /// Asynchronous submission of a task to the pool.
+ void asyncImpl(TaskTy F);
/// Threads in flight
std::vector<llvm::thread> Threads;
OpenPOWER on IntegriCloud