mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Retire redundant sp->slavesCount field
It should be used slavesMask.count() instead. Verified 100% equivalent when sp->allSlavesSearching: dbg_hit_on(sp->allSlavesSearching, sp->slavesCount != sp->slavesMask.count()); No functional change.
This commit is contained in:
@@ -155,7 +155,6 @@ void Thread::split(Position& pos, Stack* ss, Value alpha, Value beta, Value* bes
|
||||
sp.masterThread = this;
|
||||
sp.parentSplitPoint = activeSplitPoint;
|
||||
sp.slavesMask = 0, sp.slavesMask.set(idx);
|
||||
sp.slavesCount = 1;
|
||||
sp.depth = depth;
|
||||
sp.bestValue = *bestValue;
|
||||
sp.bestMove = *bestMove;
|
||||
@@ -183,11 +182,10 @@ void Thread::split(Position& pos, Stack* ss, Value alpha, Value beta, Value* bes
|
||||
|
||||
Thread* slave;
|
||||
|
||||
while ( sp.slavesCount < MAX_SLAVES_PER_SPLITPOINT
|
||||
while ( sp.slavesMask.count() < MAX_SLAVES_PER_SPLITPOINT
|
||||
&& (slave = Threads.available_slave(this)) != NULL)
|
||||
{
|
||||
sp.slavesMask.set(slave->idx);
|
||||
sp.slavesCount++;
|
||||
slave->activeSplitPoint = &sp;
|
||||
slave->searching = true; // Slave leaves idle_loop()
|
||||
slave->notify_one(); // Could be sleeping
|
||||
|
||||
Reference in New Issue
Block a user