Bug 773518 - Necko nsDeleteDir should lower IO prioritization. r=jduell

This commit is contained in:
Brian R. Bondy 2012-07-25 10:24:25 -04:00
parent 15bce0f2b8
commit 2bd6e1f69d

View File

@ -179,8 +179,16 @@ nsDeleteDir::TimerCallback(nsITimer *aTimer, void *arg)
dirList = static_cast<nsCOMArray<nsIFile> *>(arg);
bool shuttingDown = false;
for (PRInt32 i = 0; i < dirList->Count() && !shuttingDown; i++) {
gInstance->RemoveDir((*dirList)[i], &shuttingDown);
// Intentional extra braces to control variable sope.
{
// Low IO priority can only be set when running in the context of the
// current thread. So this shouldn't be moved to where we set the priority
// of the Cache deleter thread using the nsThread's NSPR priority constants.
nsAutoLowPriorityIO autoLowPriority;
for (PRInt32 i = 0; i < dirList->Count() && !shuttingDown; i++) {
gInstance->RemoveDir((*dirList)[i], &shuttingDown);
}
}
{