From: Patrick Donnelly Date: Tue, 13 Oct 2020 17:08:21 +0000 (-0700) Subject: common: accept timespan for SaferCond.wait_for X-Git-Tag: v16.1.0~814^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0feabb4ff16e5b97d90718eb677c85699e776fdb;p=ceph.git common: accept timespan for SaferCond.wait_for Signed-off-by: Patrick Donnelly --- diff --git a/src/common/Cond.h b/src/common/Cond.h index ecbd57334963..f41d0bf40702 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;