Permalink
Browse files

Unlock the startstop mutex while waiting for timer startup

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 1dc048f1b71c92e4bb81a9e2ae6766cbd2df1c16
Showing with 4 additions and 0 deletions.
  1. +4 −0 mythtv/libs/libmythbase/mythsignalingtimer.cpp
@@ -48,7 +48,11 @@ void MythSignalingTimer::start(int msec)
dorun = true;
MThread::start();
while (dorun && !running)
+ {
+ locker.unlock();
usleep(10 * 1000);
+ locker.relock();
+ }
}
}

0 comments on commit 1dc048f

Please sign in to comment.