Bug 1682948 - properly hold the CacheEntry's lock when accessing mPinned. r=necko-reviewers,dragana,decoder

Differential Revision: https://phabricator.services.mozilla.com/D100248
This commit is contained in:
Alexis Beingessner 2021-01-18 13:55:30 +00:00
parent 713bc93cba
commit 6cf6d9fd33
2 changed files with 6 additions and 8 deletions

View File

@ -299,11 +299,6 @@ extern "C" const char* __tsan_default_suppressions() {
// Bug 1682951
"race:storage::Connection::Release\n"
// Bug 1682948
"race:CacheEntry::OpenOutputStream\n"
"race:CacheEntry::GetSecurityInfo\n"
"race:CacheEntry::GetIsForcedValid\n"
// End of suppressions.
; // Please keep this semicolon.
}

View File

@ -1100,9 +1100,12 @@ nsresult CacheEntry::GetIsForcedValid(bool* aIsForcedValid) {
MOZ_ASSERT(mState > LOADING);
if (mPinned) {
*aIsForcedValid = true;
return NS_OK;
{
mozilla::MutexAutoLock lock(mLock);
if (mPinned) {
*aIsForcedValid = true;
return NS_OK;
}
}
nsAutoCString key;