scheduler: No need for gQuantumLengths to be global
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
using namespace Scheduler;
|
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)
|
ThreadData::ThreadData(Thread* thread)
|
||||||
@@ -130,21 +130,21 @@ ThreadData::ComputeQuantumLengths()
|
|||||||
for (int32 priority = 0; priority <= THREAD_MAX_SET_PRIORITY; priority++) {
|
for (int32 priority = 0; priority <= THREAD_MAX_SET_PRIORITY; priority++) {
|
||||||
const bigtime_t kQuantum0 = gCurrentMode->base_quantum;
|
const bigtime_t kQuantum0 = gCurrentMode->base_quantum;
|
||||||
if (priority >= B_URGENT_DISPLAY_PRIORITY) {
|
if (priority >= B_URGENT_DISPLAY_PRIORITY) {
|
||||||
gQuantumLengths[priority] = kQuantum0;
|
sQuantumLengths[priority] = kQuantum0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bigtime_t kQuantum1
|
const bigtime_t kQuantum1
|
||||||
= kQuantum0 * gCurrentMode->quantum_multipliers[0];
|
= kQuantum0 * gCurrentMode->quantum_multipliers[0];
|
||||||
if (priority > B_NORMAL_PRIORITY) {
|
if (priority > B_NORMAL_PRIORITY) {
|
||||||
gQuantumLengths[priority] = _ScaleQuantum(kQuantum1, kQuantum0,
|
sQuantumLengths[priority] = _ScaleQuantum(kQuantum1, kQuantum0,
|
||||||
B_URGENT_DISPLAY_PRIORITY, B_NORMAL_PRIORITY, priority);
|
B_URGENT_DISPLAY_PRIORITY, B_NORMAL_PRIORITY, priority);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bigtime_t kQuantum2
|
const bigtime_t kQuantum2
|
||||||
= kQuantum0 * gCurrentMode->quantum_multipliers[1];
|
= kQuantum0 * gCurrentMode->quantum_multipliers[1];
|
||||||
gQuantumLengths[priority] = _ScaleQuantum(kQuantum2, kQuantum1,
|
sQuantumLengths[priority] = _ScaleQuantum(kQuantum2, kQuantum1,
|
||||||
B_NORMAL_PRIORITY, B_IDLE_PRIORITY, priority);
|
B_NORMAL_PRIORITY, B_IDLE_PRIORITY, priority);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -209,7 +209,7 @@ ThreadData::_ChooseCPU(CoreEntry* core, bool& rescheduleNeeded) const
|
|||||||
inline bigtime_t
|
inline bigtime_t
|
||||||
ThreadData::_GetBaseQuantum() const
|
ThreadData::_GetBaseQuantum() const
|
||||||
{
|
{
|
||||||
return gQuantumLengths[GetEffectivePriority()];
|
return sQuantumLengths[GetEffectivePriority()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -119,8 +119,6 @@ public:
|
|||||||
virtual void operator()(ThreadData* thread) = 0;
|
virtual void operator()(ThreadData* thread) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern bigtime_t gQuantumLengths[THREAD_MAX_SET_PRIORITY + 1];
|
|
||||||
|
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
ThreadData::HasCacheExpired() const
|
ThreadData::HasCacheExpired() const
|
||||||
|
|||||||
Reference in New Issue
Block a user