mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 994560: Compute CPU priority based on priority that is going to be set r=gsvelto
This commit is contained in:
parent
aab8e51026
commit
b91de9e100
@ -61,7 +61,7 @@ function runTest()
|
||||
// Ensure that the preallocated process initially gets BACKGROUND priority.
|
||||
// That's it.
|
||||
expectProcessCreated().then(function(childID) {
|
||||
return expectPriorityChange(childID, 'PREALLOC');
|
||||
return expectPriorityChange(childID, 'PREALLOC', 'CPU_LOW');
|
||||
}).then(function() {
|
||||
// We need to set the pref asynchoronously or the preallocated process won't
|
||||
// be shut down.
|
||||
|
@ -258,7 +258,7 @@ public:
|
||||
|
||||
ProcessPriority CurrentPriority();
|
||||
ProcessPriority ComputePriority();
|
||||
ProcessCPUPriority ComputeCPUPriority();
|
||||
ProcessCPUPriority ComputeCPUPriority(ProcessPriority aPriority);
|
||||
|
||||
void ScheduleResetPriority(const char* aTimeoutPref);
|
||||
void ResetPriority();
|
||||
@ -956,13 +956,13 @@ ParticularProcessPriorityManager::ComputePriority()
|
||||
}
|
||||
|
||||
ProcessCPUPriority
|
||||
ParticularProcessPriorityManager::ComputeCPUPriority()
|
||||
ParticularProcessPriorityManager::ComputeCPUPriority(ProcessPriority aPriority)
|
||||
{
|
||||
if (mPriority == PROCESS_PRIORITY_PREALLOC) {
|
||||
if (aPriority == PROCESS_PRIORITY_PREALLOC) {
|
||||
return PROCESS_CPU_PRIORITY_LOW;
|
||||
}
|
||||
|
||||
if (mPriority >= PROCESS_PRIORITY_FOREGROUND_HIGH) {
|
||||
if (aPriority >= PROCESS_PRIORITY_FOREGROUND_HIGH) {
|
||||
return PROCESS_CPU_PRIORITY_NORMAL;
|
||||
}
|
||||
|
||||
@ -982,7 +982,7 @@ void
|
||||
ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority,
|
||||
uint32_t aBackgroundLRU)
|
||||
{
|
||||
SetPriorityNow(aPriority, ComputeCPUPriority(), aBackgroundLRU);
|
||||
SetPriorityNow(aPriority, ComputeCPUPriority(aPriority), aBackgroundLRU);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user