From 5b604dd360ffc162f163962ccb2b1af109a5f93f Mon Sep 17 00:00:00 2001 From: B Stack Date: Thu, 17 Oct 2019 15:59:39 -0400 Subject: add upstream 10.17 --- zen/thread.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'zen/thread.h') 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 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 bool wait_for_all_timed(InputIterator first, InputIterator last, const Duration& wait_duration); @@ -89,6 +93,7 @@ bool isReady(const std::future& 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 AsyncFirstResult { @@ -113,6 +118,7 @@ private: //------------------------------------------------------------------------------------------ //value associated with mutex and guaranteed protected access: +//TODO: use std::synchronized_value when available template class Protected { -- cgit