diff options
Diffstat (limited to 'libbutl/process.ixx')
-rw-r--r-- | libbutl/process.ixx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libbutl/process.ixx b/libbutl/process.ixx index c2cd892..df3b588 100644 --- a/libbutl/process.ixx +++ b/libbutl/process.ixx @@ -223,14 +223,18 @@ namespace butl return *this; } - inline bool process:: - try_wait (bool& s) - { - bool r (try_wait ()); - - if (r) - s = exit && exit->normal () && exit->code () == 0; + // Implement timed_wait() function templates in terms of their milliseconds + // specialization. + // + template <> + optional<bool> process:: + timed_wait (const std::chrono::milliseconds&); - return r; + template <typename R, typename P> + inline optional<bool> process:: + timed_wait (const std::chrono::duration<R, P>& d) + { + using namespace std::chrono; + return timed_wait (duration_cast<milliseconds> (d)); } } |