diff options
author | B. Stack <bgstack15@gmail.com> | 2022-05-22 17:03:17 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-05-22 17:03:17 -0400 |
commit | 2c81be72eef5363736cf1892646c74a3311ee4c1 (patch) | |
tree | 3894ba7e10c78750c195381a861da5e8166a6bfd /zen/thread.h | |
parent | Merge branch 'b11.20' into 'master' (diff) | |
download | FreeFileSync-2c81be72eef5363736cf1892646c74a3311ee4c1.tar.gz FreeFileSync-2c81be72eef5363736cf1892646c74a3311ee4c1.tar.bz2 FreeFileSync-2c81be72eef5363736cf1892646c74a3311ee4c1.zip |
add upstream 11.21b11.21
Diffstat (limited to 'zen/thread.h')
-rw-r--r-- | zen/thread.h | 12 |
1 files changed, 5 insertions, 7 deletions
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 <thread> #include <future> -#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<class Predicate> +template <class Predicate> void interruptibleWait(std::condition_variable& cv, std::unique_lock<std::mutex>& lock, Predicate pred); //throw ThreadStopRequest template <class Rep, class Period> @@ -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<class InputIterator, class Duration> +template <class InputIterator, class Duration> bool waitForAllTimed(InputIterator first, InputIterator last, const Duration& wait_duration); template<typename T> inline @@ -311,7 +309,7 @@ auto runAsync(Function&& fun) } -template<class InputIterator, class Duration> inline +template <class InputIterator, class Duration> 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<class Predicate> + template <class Predicate> void interruptibleWait(std::condition_variable& cv, std::unique_lock<std::mutex>& lock, Predicate pred) //throw ThreadStopRequest { setConditionVar(&cv); @@ -476,7 +474,7 @@ void interruptionPoint() //throw ThreadStopRequest //context of worker thread: -template<class Predicate> inline +template <class Predicate> inline void interruptibleWait(std::condition_variable& cv, std::unique_lock<std::mutex>& lock, Predicate pred) //throw ThreadStopRequest { assert(impl::threadLocalInterruptionStatus); |