X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=9cd63d9595476eeb2cd37bf2e7c7530a93b83a51;hp=6d07ec35f3e29d1e83295c7417481dac7c9ffead;hb=be3b8f3ae939b19dfd36ebff3f485395083a3ab9;hpb=44432f67d724573d0f6e3cfea6165c9b1d125d72 diff --git a/src/thread.cpp b/src/thread.cpp index 6d07ec35..9cd63d95 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -313,13 +313,12 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta, return bestValue; // Pick the next available split point from the split point stack - SplitPoint* sp = &master->splitPoints[master->splitPointsCnt++]; + SplitPoint* sp = &master->splitPoints[master->splitPointsCnt]; sp->parent = master->curSplitPoint; sp->master = master; sp->cutoff = false; sp->slavesMask = 1ULL << master->idx; - sp->allSlavesMask = 1ULL << master->idx; sp->depth = depth; sp->bestMove = *bestMove; sp->threatMove = threatMove; @@ -348,7 +347,6 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta, if (threads[i]->is_available_to(master)) { sp->slavesMask |= 1ULL << i; - sp->allSlavesMask |= 1ULL << i; threads[i]->curSplitPoint = sp; threads[i]->is_searching = true; // Slave leaves idle_loop() @@ -356,12 +354,11 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta, threads[i]->wake_up(); if (++slavesCnt + 1 >= maxThreadsPerSplitPoint) // Master is always included - { - sp->allSlavesMask = 0; // Disable reparenting to this split point break; - } } + master->splitPointsCnt++; + lock_release(splitLock); lock_release(sp->lock);