зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1036679 - MediaStreamGraph shutdown can hang if happening in conjunction with a memory report. r=roc
This commit is contained in:
Родитель
86555a0dfd
Коммит
9724ad20af
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче