From 814fe66b4f1060c3158ce460344ba84f732e878a Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 2 Sep 2015 08:36:29 -0700 Subject: [PATCH] rgw: wake up wait coroutine thread on destruction Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_sync.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 3d36d979f4136..563db25b8e14d 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -765,6 +765,11 @@ public: RGWAsyncWait(RGWAioCompletionNotifier *cn, CephContext *_cct, Mutex *_lock, Cond *_cond, int _secs) : RGWAsyncRadosRequest(cn), cct(_cct), lock(_lock), cond(_cond), interval(_secs, 0) {} + + void wakeup() { + Mutex::Locker l(*lock); + cond->Signal(); + } }; class RGWWaitCR : public RGWSimpleCoroutine { @@ -784,6 +789,7 @@ public: } ~RGWWaitCR() { + wakeup(); delete req; } @@ -796,6 +802,10 @@ public: int request_complete() { return req->get_ret_status(); } + + void wakeup() { + req->wakeup(); + } }; class RGWAsyncReadMDLogEntries : public RGWAsyncRadosRequest { -- 2.39.5