зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1595596 - Always wait on Prefetch thread before touching mCacheData r=froydnj
This is not, AFAICT, causing crashes - it is just an oversight noticed while investigating the crash in the bug. Differential Revision: https://phabricator.services.mozilla.com/D53042 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
759822ddcd
Коммит
28daeac06d
|
@ -276,6 +276,7 @@ Result<Ok, nsresult> StartupCache::LoadArchive() {
|
|||
return Err(NS_ERROR_UNEXPECTED);
|
||||
}
|
||||
auto cleanup = MakeScopeExit([&]() {
|
||||
WaitOnPrefetchThread();
|
||||
mTable.clear();
|
||||
mCacheData.reset();
|
||||
});
|
||||
|
@ -564,6 +565,7 @@ Result<Ok, nsresult> StartupCache::WriteToDisk() {
|
|||
|
||||
void StartupCache::InvalidateCache(bool memoryOnly) {
|
||||
WaitOnWriteThread();
|
||||
WaitOnPrefetchThread();
|
||||
mWrittenOnce = false;
|
||||
if (memoryOnly) {
|
||||
auto writeResult = WriteToDisk();
|
||||
|
|
Загрузка…
Ссылка в новой задаче