Skip to content

Commit

Permalink
Unlock the startstop mutex while waiting for timer startup
Browse files Browse the repository at this point in the history
If we start and stop the timer too quickly, the lock can be still held by
the start() function, and the stop() sits deadlocked waiting for it.  As this
delay is primarily to wait for the thread to come up before returning from
start(), it should be safe to release the mutex while waiting to allow the
stop() to take effect.

If this doesn't fix the issue, please reopen the ticket

Fixes #10867
  • Loading branch information
Beirdo committed Jul 13, 2012
1 parent a3aa6f5 commit 1dc048f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mythtv/libs/libmythbase/mythsignalingtimer.cpp
Expand Up @@ -48,7 +48,11 @@ void MythSignalingTimer::start(int msec)
dorun = true;
MThread::start();
while (dorun && !running)
{
locker.unlock();
usleep(10 * 1000);
locker.relock();
}
}
}

Expand Down

0 comments on commit 1dc048f

Please sign in to comment.