From 2c81be72eef5363736cf1892646c74a3311ee4c1 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 22 May 2022 17:03:17 -0400 Subject: add upstream 11.21 --- zen/thread.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'zen/thread.h') diff --git a/zen/thread.h b/zen/thread.h index 136c7a5c..42fba281 100644 --- a/zen/thread.h +++ b/zen/thread.h @@ -9,9 +9,7 @@ #include #include -#include "scope_guard.h" #include "ring_buffer.h" -#include "string_tools.h" #include "zstring.h" @@ -65,7 +63,7 @@ class ThreadStopRequest {}; //context of worker thread: void interruptionPoint(); //throw ThreadStopRequest -template +template void interruptibleWait(std::condition_variable& cv, std::unique_lock& lock, Predicate pred); //throw ThreadStopRequest template @@ -90,7 +88,7 @@ auto runAsync(Function&& fun); //wait for all with a time limit: return true if *all* results are available! //TODO: use std::when_all when available -template +template bool waitForAllTimed(InputIterator first, InputIterator last, const Duration& wait_duration); template inline @@ -311,7 +309,7 @@ auto runAsync(Function&& fun) } -template inline +template inline bool waitForAllTimed(InputIterator first, InputIterator last, const Duration& duration) { const std::chrono::steady_clock::time_point stopTime = std::chrono::steady_clock::now() + duration; @@ -417,7 +415,7 @@ public: } //context of worker thread: - template + template void interruptibleWait(std::condition_variable& cv, std::unique_lock& lock, Predicate pred) //throw ThreadStopRequest { setConditionVar(&cv); @@ -476,7 +474,7 @@ void interruptionPoint() //throw ThreadStopRequest //context of worker thread: -template inline +template inline void interruptibleWait(std::condition_variable& cv, std::unique_lock& lock, Predicate pred) //throw ThreadStopRequest { assert(impl::threadLocalInterruptionStatus); -- cgit