scheduler: Fix divide by zero on CPU disable

This commit is contained in:
Pawel Dziepak
2014-01-16 23:26:10 +01:00
parent f978518a52
commit 0d27a57cf1
@@ -194,7 +194,9 @@ ThreadData::ComputeQuantum() const
if (IsRealTime())
return quantum;
int32 threadCount = fCore->ThreadCount() / fCore->CPUCount();
int32 threadCount = fCore->ThreadCount();
if (fCore->CPUCount() > 0)
threadCount /= fCore->CPUCount();
if (threadCount >= 1) {
quantum
= std::min(gCurrentMode->maximum_latency / threadCount, quantum);