From cde8746409e224dcc2b53939d478bb71f29fec9e Mon Sep 17 00:00:00 2001 From: wqking Date: Thu, 9 Mar 2023 15:25:52 +0800 Subject: [PATCH] Added mutex lock in function CallbackListBase::ownsHandle to avoid racing condition. See issue #57 --- include/eventpp/callbacklist.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/eventpp/callbacklist.h b/include/eventpp/callbacklist.h index 7048bf4..947dc51 100644 --- a/include/eventpp/callbacklist.h +++ b/include/eventpp/callbacklist.h @@ -243,6 +243,8 @@ public: bool ownsHandle(const Handle & handle) const { + std::lock_guard lockGuard(mutex); + auto node = handle.lock(); if(node) { while(node->previous) {