diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-10-28 23:21:40 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-10-28 23:21:40 +0000 |
commit | 8d6d4e48a61fd974c3fb2a85254f9bedd796a2b7 (patch) | |
tree | 65292208a81994782e1c16dd84dfcdcc221d0cd7 /zen/thread.h | |
parent | Merge branch '10.16' into 'master' (diff) | |
parent | add upstream 10.17 (diff) | |
download | FreeFileSync-8d6d4e48a61fd974c3fb2a85254f9bedd796a2b7.tar.gz FreeFileSync-8d6d4e48a61fd974c3fb2a85254f9bedd796a2b7.tar.bz2 FreeFileSync-8d6d4e48a61fd974c3fb2a85254f9bedd796a2b7.zip |
Merge branch '10.17' into 'master'10.17
10.17
See merge request opensource-tracking/FreeFileSync!14
Diffstat (limited to 'zen/thread.h')
-rw-r--r-- | zen/thread.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/zen/thread.h b/zen/thread.h index 791aec67..d6cafab7 100644 --- a/zen/thread.h +++ b/zen/thread.h @@ -18,6 +18,9 @@ namespace zen { class InterruptionStatus; +#if __cpp_lib_jthread + #error refactor! +#endif class InterruptibleThread { public: @@ -81,6 +84,7 @@ template <class Function> 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> bool wait_for_all_timed(InputIterator first, InputIterator last, const Duration& wait_duration); @@ -89,6 +93,7 @@ bool isReady(const std::future<T>& f) { return f.wait_for(std::chrono::seconds(0 //------------------------------------------------------------------------------------------ //wait until first job is successful or all failed: substitute until std::when_any is available +//TODO: use std::when_any when available template <class T> class AsyncFirstResult { @@ -113,6 +118,7 @@ private: //------------------------------------------------------------------------------------------ //value associated with mutex and guaranteed protected access: +//TODO: use std::synchronized_value when available template <class T> class Protected { |