From 13ed4504d9436661fcbdafcea3c5a640332443cb Mon Sep 17 00:00:00 2001 From: "chuanhong.wang" Date: Mon, 14 Aug 2017 08:49:28 +0000 Subject: [PATCH] Fix a dead lock when running fio: "RDMADispatcher::polling_stop" hold the lock and wait "RDMADispatcher::polling" ending, then RDMADispatcher::polling can't hold the lock and can't end its work. Signed-off-by: Wang Chuanhong --- src/msg/async/rdma/RDMAStack.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/msg/async/rdma/RDMAStack.cc b/src/msg/async/rdma/RDMAStack.cc index dcc6e1a8fb3..7e5c9d3e9bf 100644 --- a/src/msg/async/rdma/RDMAStack.cc +++ b/src/msg/async/rdma/RDMAStack.cc @@ -99,8 +99,11 @@ void RDMADispatcher::polling_start() void RDMADispatcher::polling_stop() { - Mutex::Locker l(lock); - done = true; + { + Mutex::Locker l(lock); + done = true; + } + if (!t.joinable()) return; -- 2.47.3