diff options
author | B Stack <bgstack15@gmail.com> | 2019-10-17 15:59:39 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-10-17 15:59:39 -0400 |
commit | 5b604dd360ffc162f163962ccb2b1af109a5f93f (patch) | |
tree | 65292208a81994782e1c16dd84dfcdcc221d0cd7 /zen/thread.h | |
parent | Merge branch '10.16' into 'master' (diff) | |
download | FreeFileSync-5b604dd360ffc162f163962ccb2b1af109a5f93f.tar.gz FreeFileSync-5b604dd360ffc162f163962ccb2b1af109a5f93f.tar.bz2 FreeFileSync-5b604dd360ffc162f163962ccb2b1af109a5f93f.zip |
add upstream 10.17
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 { |