Fixed fake CPU handling.
This commit is contained in:
parent
6a082c42d3
commit
27610989a2
|
@ -154,17 +154,14 @@ void XThread::set_name(const std::string& name) {
|
|||
uint8_t next_cpu = 0;
|
||||
uint8_t GetFakeCpuNumber(uint8_t proc_mask) {
|
||||
if (!proc_mask) {
|
||||
next_cpu++;
|
||||
if (next_cpu > 6) {
|
||||
next_cpu = 0;
|
||||
}
|
||||
|
||||
next_cpu = (next_cpu + 1) % 6;
|
||||
return next_cpu; // is this reasonable?
|
||||
}
|
||||
assert_false(proc_mask & 0xC0);
|
||||
|
||||
uint8_t cpu_number = 7 - xe::lzcnt(proc_mask);
|
||||
assert_true(1 << cpu_number == proc_mask);
|
||||
assert_true(cpu_number < 6);
|
||||
return cpu_number;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue