]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: check completion condition before waiting 23435/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 19 Jul 2018 20:54:12 +0000 (13:54 -0700)
committerPrashant D <pdhange@redhat.com>
Mon, 6 Aug 2018 00:19:07 +0000 (20:19 -0400)
Fixes: http://tracker.ceph.com/issues/25007
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 7090ea24dd5d5538585a690e7cee268f32328c26)

src/common/Cond.h

index 524f23cb603f0540461060faa47404a6ea711b07..14842e3992ed8f5e425600cec7d6de2cd6bc88ea 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;
   }