X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fthread.cpp;h=358ced5dec3bf26eb823af4bd82ad8041801ca89;hb=55376219b7cd17c1dc5d8361e969f30e5421e87e;hp=4fa081482ffab4144de201a4fd56014e25c1be19;hpb=3441e0075decb1acd8d3b4020b7822f743613124;p=stockfish diff --git a/src/thread.cpp b/src/thread.cpp index 4fa08148..358ced5d 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -216,6 +216,8 @@ void ThreadsManager::set_size(int cnt) { void ThreadsManager::init() { + read_uci_options(); + cond_init(sleepCond); lock_init(splitLock); @@ -299,8 +301,8 @@ bool ThreadsManager::available_slave_exists(int master) const { template Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta, - Value bestValue, Depth depth, Move threatMove, - int moveCount, MovePicker* mp, int nodeType) { + Value bestValue, Move* bestMove, Depth depth, + Move threatMove, int moveCount, MovePicker *mp, int nodeType) { assert(pos.pos_is_ok()); assert(bestValue > -VALUE_INFINITE); assert(bestValue <= alpha); @@ -324,6 +326,7 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta, sp->cutoff = false; sp->slavesMask = 1ULL << master; sp->depth = depth; + sp->bestMove = *bestMove; sp->threatMove = threatMove; sp->alpha = alpha; sp->beta = beta; @@ -387,6 +390,7 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta, masterThread.splitPointsCnt--; masterThread.curSplitPoint = sp->parent; pos.set_nodes_searched(pos.nodes_searched() + sp->nodes); + *bestMove = sp->bestMove; lock_release(splitLock); lock_release(sp->lock); @@ -395,8 +399,8 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta, } // Explicit template instantiations -template Value ThreadsManager::split(Position&, Stack*, Value, Value, Value, Depth, Move, int, MovePicker*, int); -template Value ThreadsManager::split(Position&, Stack*, Value, Value, Value, Depth, Move, int, MovePicker*, int); +template Value ThreadsManager::split(Position&, Stack*, Value, Value, Value, Move*, Depth, Move, int, MovePicker*, int); +template Value ThreadsManager::split(Position&, Stack*, Value, Value, Value, Move*, Depth, Move, int, MovePicker*, int); // ThreadsManager::set_timer() is used to set the timer to trigger after msec