From 39a207ce62f7b5a4e72af0ff57488bfdbf6800bf Mon Sep 17 00:00:00 2001 From: xiao <821008736@qq.com> Date: Tue, 28 Mar 2023 04:48:54 +0800 Subject: [PATCH] Avoid epoll_wait causing the lock to not be released (#3983) * Avoid epoll_wait causing the lock to not be released. * code style --- Net/src/PollSet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Net/src/PollSet.cpp b/Net/src/PollSet.cpp index dfd59b62d..a1b819201 100644 --- a/Net/src/PollSet.cpp +++ b/Net/src/PollSet.cpp @@ -169,7 +169,6 @@ public: Poco::Timespan remainingTime(timeout); int rc; - ScopedLock lock(_mutex); do { Poco::Timestamp start; @@ -199,6 +198,8 @@ public: } while (false); + ScopedLock lock(_mutex); + for (int i = 0; i < rc; i++) { if (_events[i].data.ptr) // skip eventfd