Bug 1036679 - MediaStreamGraph shutdown can hang if happening in conjunction with a memory report. r=roc

This commit is contained in:
Eric Rahm 2014-07-09 17:22:37 -07:00
Родитель 86555a0dfd
Коммит 9724ad20af
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -2789,9 +2789,15 @@ MediaStreamGraphImpl::CollectReports(nsIHandleReportCallback* aHandleReport,
EnsureImmediateWakeUpLocked(monitorLock);
}
// Wait for the report to complete.
if (mLifecycleState >= LIFECYCLE_WAITING_FOR_THREAD_SHUTDOWN) {
// Shutting down, nothing to report.
return NS_OK;
}
// Wait for up to one second for the report to complete.
nsresult rv;
while ((rv = memoryReportLock.Wait()) != NS_OK) {
const PRIntervalTime kMaxWait = PR_SecondsToInterval(1);
while ((rv = memoryReportLock.Wait(kMaxWait)) != NS_OK) {
if (PR_GetError() != PR_PENDING_INTERRUPT_ERROR) {
return rv;
}