mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1132172 - Don't access CacheEntry::mFrecency on non-cache threads. r=michal
This commit is contained in:
parent
cb52dfe127
commit
e660be665f
@ -1594,7 +1594,7 @@ void CacheEntry::BackgroundOp(uint32_t aOperations, bool aForceAsync)
|
||||
// Because CacheFile::Set*() are not thread-safe to use (uses WeakReference that
|
||||
// is not thread-safe) we must post to the main thread...
|
||||
nsRefPtr<nsRunnableMethod<CacheEntry> > event =
|
||||
NS_NewRunnableMethod(this, &CacheEntry::StoreFrecency);
|
||||
NS_NewRunnableMethodWithArg<double>(this, &CacheEntry::StoreFrecency, mFrecency);
|
||||
NS_DispatchToMainThread(event);
|
||||
}
|
||||
|
||||
@ -1618,14 +1618,12 @@ void CacheEntry::BackgroundOp(uint32_t aOperations, bool aForceAsync)
|
||||
}
|
||||
}
|
||||
|
||||
void CacheEntry::StoreFrecency()
|
||||
void CacheEntry::StoreFrecency(double aFrecency)
|
||||
{
|
||||
// No need for thread safety over mFrecency, it will be rewriten
|
||||
// correctly on following invocation if broken by concurrency.
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (NS_SUCCEEDED(mFileStatus)) {
|
||||
mFile->SetFrecency(FRECENCY2INT(mFrecency));
|
||||
mFile->SetFrecency(FRECENCY2INT(aFrecency));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ private:
|
||||
// When executed on the management thread directly, the operation(s)
|
||||
// is (are) executed immediately.
|
||||
void BackgroundOp(uint32_t aOperation, bool aForceAsync = false);
|
||||
void StoreFrecency();
|
||||
void StoreFrecency(double aFrecency);
|
||||
|
||||
// Called only from DoomAlreadyRemoved()
|
||||
void DoomFile();
|
||||
|
Loading…
Reference in New Issue
Block a user