scheduler: No need for gQuantumLengths to be global

This commit is contained in:
Pawel Dziepak 2013-12-26 19:36:39 +01:00
parent cf4984f645
commit ebe5420f84
2 changed files with 5 additions and 7 deletions

View File

@ -9,7 +9,7 @@
using namespace Scheduler;
bigtime_t Scheduler::gQuantumLengths[THREAD_MAX_SET_PRIORITY + 1];
static bigtime_t sQuantumLengths[THREAD_MAX_SET_PRIORITY + 1];
ThreadData::ThreadData(Thread* thread)
@ -130,21 +130,21 @@ ThreadData::ComputeQuantumLengths()
for (int32 priority = 0; priority <= THREAD_MAX_SET_PRIORITY; priority++) {
const bigtime_t kQuantum0 = gCurrentMode->base_quantum;
if (priority >= B_URGENT_DISPLAY_PRIORITY) {
gQuantumLengths[priority] = kQuantum0;
sQuantumLengths[priority] = kQuantum0;
continue;
}
const bigtime_t kQuantum1
= kQuantum0 * gCurrentMode->quantum_multipliers[0];
if (priority > B_NORMAL_PRIORITY) {
gQuantumLengths[priority] = _ScaleQuantum(kQuantum1, kQuantum0,
sQuantumLengths[priority] = _ScaleQuantum(kQuantum1, kQuantum0,
B_URGENT_DISPLAY_PRIORITY, B_NORMAL_PRIORITY, priority);
continue;
}
const bigtime_t kQuantum2
= kQuantum0 * gCurrentMode->quantum_multipliers[1];
gQuantumLengths[priority] = _ScaleQuantum(kQuantum2, kQuantum1,
sQuantumLengths[priority] = _ScaleQuantum(kQuantum2, kQuantum1,
B_NORMAL_PRIORITY, B_IDLE_PRIORITY, priority);
}
}
@ -209,7 +209,7 @@ ThreadData::_ChooseCPU(CoreEntry* core, bool& rescheduleNeeded) const
inline bigtime_t
ThreadData::_GetBaseQuantum() const
{
return gQuantumLengths[GetEffectivePriority()];
return sQuantumLengths[GetEffectivePriority()];
}

View File

@ -119,8 +119,6 @@ public:
virtual void operator()(ThreadData* thread) = 0;
};
extern bigtime_t gQuantumLengths[THREAD_MAX_SET_PRIORITY + 1];
inline bool
ThreadData::HasCacheExpired() const