зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1614706 - ThreadSanitizer: data race [@ Release] vs. [@ CloseWithStatusLocked] in CacheFileInputStream r=mayhemer
Acquiring the lock is moved from CacheFile::RemoveInput() to CacheFileInputStream::Release(). This fixes the data race and is consistent with CacheFile::RemoveOutput() which is also called under the lock. Differential Revision: https://phabricator.services.mozilla.com/D62504 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0bcf2288ef
Коммит
32b5d4c391
|
@ -2065,7 +2065,7 @@ static uint32_t StatusToTelemetryEnum(nsresult aStatus) {
|
|||
}
|
||||
|
||||
void CacheFile::RemoveInput(CacheFileInputStream* aInput, nsresult aStatus) {
|
||||
CacheFileAutoLock lock(this);
|
||||
AssertOwnsLock();
|
||||
|
||||
LOG(("CacheFile::RemoveInput() [this=%p, input=%p, status=0x%08" PRIx32 "]",
|
||||
this, aInput, static_cast<uint32_t>(aStatus)));
|
||||
|
|
|
@ -27,6 +27,7 @@ CacheFileInputStream::Release() {
|
|||
}
|
||||
|
||||
if (count == 1) {
|
||||
CacheFileAutoLock lock(mFile);
|
||||
mFile->RemoveInput(this, mStatus);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче