Bug 1531798 - Avoid deadlock when dumping a profile while the IOInterposer is active, r=gerald,mstange.

Differential Revision: https://phabricator.services.mozilla.com/D21712

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Florian Quèze 2019-03-05 12:01:33 +00:00
Родитель fa021187df
Коммит 6522db5f93
1 изменённых файлов: 28 добавлений и 1 удалений

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

@ -777,13 +777,33 @@ class ActivePS {
#if !defined(RELEASE_OR_BETA)
static void UnregisterIOInterposer(PSLockRef) {
if (!sInstance->mInterposeObserver) return;
if (!sInstance->mInterposeObserver) {
return;
}
IOInterposer::Unregister(IOInterposeObserver::OpAll,
sInstance->mInterposeObserver);
sInstance->mInterposeObserver = nullptr;
}
static void PauseIOInterposer(PSLockRef) {
if (!sInstance->mInterposeObserver) {
return;
}
IOInterposer::Unregister(IOInterposeObserver::OpAll,
sInstance->mInterposeObserver);
}
static void ResumeIOInterposer(PSLockRef) {
if (!sInstance->mInterposeObserver) {
return;
}
IOInterposer::Register(IOInterposeObserver::OpAll,
sInstance->mInterposeObserver);
}
#endif
static void ClearExpiredExitProfiles(PSLockRef) {
@ -2092,8 +2112,15 @@ bool profiler_stream_json_for_this_process(SpliceableJSONWriter& aWriter,
return false;
}
#if !defined(RELEASE_OR_BETA)
ActivePS::PauseIOInterposer(lock);
#endif
locked_profiler_stream_json_for_this_process(lock, aWriter, aSinceTime,
aIsShuttingDown);
#if !defined(RELEASE_OR_BETA)
ActivePS::ResumeIOInterposer(lock);
#endif
return true;
}