[tbb-commits] [tor-browser] 08/37: Bug 1692724: More don't spawn a second save thread if one already exists. r=mccr8, a=RyanVM

gitolite role git at cupani.torproject.org
Wed Jun 22 18:27:17 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.11.0esr-11.5-1
in repository tor-browser.

commit 02b4f39287c13034ba4a0209808d46540088cdfd
Author: Kris Maglione <maglione.k at gmail.com>
AuthorDate: Mon Apr 25 20:02:37 2022 +0000

    Bug 1692724: More don't spawn a second save thread if one already exists. r=mccr8, a=RyanVM
    
    Bug 1610246 handled this for the other caller of StartCacheWrite. The idea
    behind not adding an explicit check was that `mSaveComplete` should usually
    imply `!mSaveThread`. However, when there's nothing in the cache to save,
    `PrepareCacheWriteInternal` sets `mSaveComplete` to true before the save
    thread shuts down. And when we have two cache flushes in the same session due
    to multiple extension upgrades, that can lead to us hitting the cache flush
    codepath in the middle of that critical period.
    
    Differential Revision: https://phabricator.services.mozilla.com/D121130
---
 js/xpconnect/loader/ScriptPreloader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/xpconnect/loader/ScriptPreloader.cpp b/js/xpconnect/loader/ScriptPreloader.cpp
index c54a860af2eb5..85c0f9c01fc86 100644
--- a/js/xpconnect/loader/ScriptPreloader.cpp
+++ b/js/xpconnect/loader/ScriptPreloader.cpp
@@ -291,7 +291,7 @@ void ScriptPreloader::InvalidateCache() {
     // of any cache file we've already written out this session, which will
     // prevent us from falling back to the current session's cache file on the
     // next startup.
-    if (mSaveComplete && mChildCache) {
+    if (mSaveComplete && !mSaveThread && mChildCache) {
       mSaveComplete = false;
 
       StartCacheWrite();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list