From: Patrick Donnelly Date: Thu, 19 Jul 2018 20:54:12 +0000 (-0700) Subject: common: check completion condition before waiting X-Git-Tag: v13.2.2~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23435%2Fhead;p=ceph.git common: check completion condition before waiting Fixes: http://tracker.ceph.com/issues/25007 Signed-off-by: Patrick Donnelly (cherry picked from commit 7090ea24dd5d5538585a690e7cee268f32328c26) --- diff --git a/src/common/Cond.h b/src/common/Cond.h index 524f23cb603f..14842e3992ed 100644 --- a/src/common/Cond.h +++ b/src/common/Cond.h @@ -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; }