diff options
-rw-r--r-- | libbutl/mingw-condition_variable.hxx | 8 | ||||
-rw-r--r-- | libbutl/mingw-mutex.hxx | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/libbutl/mingw-condition_variable.hxx b/libbutl/mingw-condition_variable.hxx index ce94941..965f533 100644 --- a/libbutl/mingw-condition_variable.hxx +++ b/libbutl/mingw-condition_variable.hxx @@ -126,9 +126,17 @@ public: const std::chrono::duration<Rep, Period>& rel_time, Predicate pred) { +#if __cplusplus >= 201703L + using steady_duration = typename std::chrono::steady_clock::duration; + return wait_until(lock, + std::chrono::steady_clock::now() + + std::chrono::ceil<steady_duration> (rel_time), + std::move(pred)); +#else return wait_until(lock, std::chrono::steady_clock::now() + rel_time, std::move(pred)); +#endif } template <class Clock, class Duration> cv_status wait_until (unique_lock<mutex>& lock, diff --git a/libbutl/mingw-mutex.hxx b/libbutl/mingw-mutex.hxx index 375a572..d297786 100644 --- a/libbutl/mingw-mutex.hxx +++ b/libbutl/mingw-mutex.hxx @@ -81,11 +81,6 @@ namespace mingw_stdthread // Slim Reader-Writer (SRW)-based implementation that requires Windows 7. // -#if !defined(SRWLOCK_INIT) -#error SRWLOCK_INIT macro is not defined -//#define SRWLOCK_INIT {0} -#endif - class mutex { protected: |