diff options
author | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
commit | 54c2e44d7b37b2c3efc449e054eef21fa414dfde (patch) | |
tree | 3894ba7e10c78750c195381a861da5e8166a6bfd /zen/thread.h | |
parent | Merge branch 'b11.20' into 'master' (diff) | |
parent | add upstream 11.21 (diff) | |
download | FreeFileSync-11.21.tar.gz FreeFileSync-11.21.tar.bz2 FreeFileSync-11.21.zip |
Merge branch 'b11.21' into 'master'11.21
add upstream 11.21
See merge request opensource-tracking/FreeFileSync!44
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); |