]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: check completion condition before waiting 23134/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 19 Jul 2018 20:54:12 +0000 (13:54 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 19 Jul 2018 20:54:12 +0000 (13:54 -0700)
Fixes: http://tracker.ceph.com/issues/25007
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/common/Cond.h

index 4c26edea955276ec446239a3a12af6078e985b7a..949f2933432cc7cb204f08559117a2370e56cbe9 100644 (file)
@@ -201,6 +201,9 @@ public:
     utime_t interval;
     interval.set_from_double(secs);
     Mutex::Locker l{lock};
+    if (done) {
+      return rval;
+    }
     cond.WaitInterval(lock, interval);
     return done ? rval : ETIMEDOUT;
   }