vopl commented on code in PR #369:
URL: https://github.com/apache/logging-log4cxx/pull/369#discussion_r1575988574
##########
src/main/cpp/filewatchdog.cpp:
##########
@@ -74,11 +74,7 @@ void FileWatchdog::stop()
{
LogLog::debug(LOG4CXX_STR("Stopping file watchdog"));
m_priv->interrupted = 0xFFFF;
-
- {
- std::unique_lock<std::mutex> lock(m_priv->interrupt_mutex);
- m_priv->interrupt.notify_all();
- }
+ m_priv->interrupt.notify_all();
Review Comment:
There must be a mutex lock between the condition change and cv-notify.
Without such a lock the notification can be loosed. Please, take an attention.
An atomic condition cannot be a reason for cancellation of a mutex lock, cv
logic absolutely requires such a lock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]