From 0feabb4ff16e5b97d90718eb677c85699e776fdb Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 13 Oct 2020 10:08:21 -0700 Subject: [PATCH] common: accept timespan for SaferCond.wait_for Signed-off-by: Patrick Donnelly --- src/common/Cond.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/Cond.h b/src/common/Cond.h index ecbd573349633..f41d0bf40702e 100644 --- a/src/common/Cond.h +++ b/src/common/Cond.h @@ -103,11 +103,15 @@ public: /// Wait until the \c secs expires or \c complete() is called int wait_for(double secs) { + return wait_for(ceph::make_timespan(secs)); + } + + int wait_for(ceph::timespan secs) { std::unique_lock l{lock}; if (done) { return rval; } - if (cond.wait_for(l, ceph::make_timespan(secs), [this] { return done; })) { + if (cond.wait_for(l, secs, [this] { return done; })) { return rval; } else { return ETIMEDOUT; -- 2.39.5