Skip to content

Commit 000b9bd

Browse files
TSAN caught data race; added protective locks
1 parent 906be78 commit 000b9bd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

VCellMessaging/src/MessageEventManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ void MessageEventManager::processQueue() {
8383
// Wait for the worker to be "prodded" (via `needMessagingForeman.notify_one()`), AND the event queue is not empty
8484
// Note that this `wait()` call, by design, unlocks the queue mutex, until it is "prodded".
8585
this->needMessageProcessingForeman.wait(shouldBeActiveLock);
86+
std::unique_lock stopRequestedLock{this->stopRequestedMutex};
8687
if (this->eventQueue.empty()) continue; // Probably means we need to check if stop was requested again
8788
}
89+
std::unique_lock stopRequestedLock{this->stopRequestedMutex};
8890
event = this->eventQueue.front();
8991
this->eventQueue.pop();
9092
}// END Clock-out Scope //

0 commit comments

Comments
 (0)