]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: accept timespan for SaferCond.wait_for
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 13 Oct 2020 17:08:21 +0000 (10:08 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 13 Oct 2020 17:09:53 +0000 (10:09 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/common/Cond.h

index ecbd57334963364df416accbdaeb6194b2d41916..f41d0bf40702e98d1061836b6cbd0393982176f2 100644 (file)
@@ -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;