diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2016-10-12T13·49+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2016-10-12T13·49+0200 |
commit | 82e2a070e0d2a617cb47c285e176a3fff3ca64e8 (patch) | |
tree | 1244c7b943514a66e6495fceaaf7f198294e6a84 /src/libutil/sync.hh | |
parent | edf9eb8181e01f6b2123e5690019cfeeb44fc1c2 (diff) |
Add some functions needed by hydra
Diffstat (limited to 'src/libutil/sync.hh')
-rw-r--r-- | src/libutil/sync.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/sync.hh b/src/libutil/sync.hh index ebe64ffbdab7..2aa074299b23 100644 --- a/src/libutil/sync.hh +++ b/src/libutil/sync.hh @@ -54,6 +54,14 @@ public: cv.wait(lk); } + template<class Rep, class Period> + void wait_for(std::condition_variable & cv, + const std::chrono::duration<Rep, Period> & duration) + { + assert(s); + cv.wait_for(lk, duration); + } + template<class Rep, class Period, class Predicate> bool wait_for(std::condition_variable & cv, const std::chrono::duration<Rep, Period> & duration, |