Bug 1036515 - narrow the scope of unlocking mMonitor in nsTimerImpl::PostTimerEvents; r=bsmedberg

This commit is contained in:
Nathan Froyd 2015-02-06 16:19:36 -05:00
Родитель ac15c5cc80
Коммит 87e4b4c13f
1 изменённых файлов: 27 добавлений и 27 удалений

Просмотреть файл

@ -260,10 +260,6 @@ TimerThread::Run()
RemoveTimerInternal(timer);
timer = nullptr;
{
// We release mMonitor around the Fire call to avoid deadlock.
MonitorAutoUnlock unlock(mMonitor);
#ifdef DEBUG_TIMERS
if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
PR_LOG(GetTimerLog(), PR_LOG_DEBUG,
@ -272,10 +268,15 @@ TimerThread::Run()
}
#endif
{
// We release mMonitor around the Fire call to avoid deadlock.
MonitorAutoUnlock unlock(mMonitor);
// We are going to let the call to PostTimerEvent here handle the
// release of the timer so that we don't end up releasing the timer
// on the TimerThread instead of on the thread it targets.
timerRef = nsTimerImpl::PostTimerEvent(timerRef.forget());
}
if (timerRef) {
// We got our reference back due to an error.
@ -297,7 +298,6 @@ TimerThread::Run()
// preventing this situation from occurring.
MOZ_ASSERT(rc != 0, "destroyed timer off its target thread!");
}
}
if (mShutdown) {
break;