Skip to content

Commit

Permalink
Fix the deadlocking on exit caused by the timer changes for logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Beirdo committed Jun 19, 2012
1 parent e74071c commit fdeb3d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mythtv/libs/libmythbase/logging.cpp
Expand Up @@ -379,6 +379,10 @@ void LoggerThread::run(void)
qLock.relock();
}

// This must be before the timer stop below or we deadlock when the timer
// thread tries to deregister, and we wait for it.
logThreadFinished = true;

m_heartbeatTimer->stop();
delete m_heartbeatTimer;
m_heartbeatTimer = NULL;
Expand All @@ -389,8 +393,6 @@ void LoggerThread::run(void)
if (!m_locallogs)
delete m_zmqContext;

logThreadFinished = true;

qLock.unlock();

RunEpilog();
Expand Down

0 comments on commit fdeb3d1

Please sign in to comment.