1
0
mirror of https://github.com/wqking/eventpp.git synced 2024-12-26 15:52:40 +08:00

Added mutex lock in function CallbackListBase::ownsHandle to avoid racing condition. See issue #57

This commit is contained in:
wqking 2023-03-09 15:25:52 +08:00
parent 0fe5dd65af
commit cde8746409

View File

@ -243,6 +243,8 @@ public:
bool ownsHandle(const Handle & handle) const bool ownsHandle(const Handle & handle) const
{ {
std::lock_guard<Mutex> lockGuard(mutex);
auto node = handle.lock(); auto node = handle.lock();
if(node) { if(node) {
while(node->previous) { while(node->previous) {