X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=ca87e1ddaec9426ee95c181f62397ac3d7b0f1a2;hp=bd20361daff658cd31a9e955fe585d3473a1c7e4;hb=94dd204c3b10ebe0e6c8df5d7c98de5ba4906cad;hpb=5cbcff55cc3a2ff78dd83e7a3f94c5414946f82c diff --git a/src/thread.cpp b/src/thread.cpp index bd20361d..ca87e1dd 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -69,12 +69,12 @@ void ThreadBase::notify_one() { } -// wait_for() set the thread to sleep until condition 'b' turns true +// wait_for() set the thread to sleep until 'condition' turns true -void ThreadBase::wait_for(volatile const bool& b) { +void ThreadBase::wait_for(volatile const bool& condition) { mutex.lock(); - while (!b) sleepCondition.wait(mutex); + while (!condition) sleepCondition.wait(mutex); mutex.unlock(); } @@ -255,7 +255,7 @@ Thread* ThreadPool::available_slave(const Thread* master) const { // leave their idle loops and call search(). When all threads have returned from // search() then split() returns. -void Thread::split(Position& pos, const Stack* ss, Value alpha, Value beta, Value* bestValue, +void Thread::split(Position& pos, Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove, Depth depth, int moveCount, MovePicker* movePicker, int nodeType, bool cutNode) { @@ -341,10 +341,10 @@ void Thread::split(Position& pos, const Stack* ss, Value alpha, Value beta, Valu void ThreadPool::wait_for_think_finished() { - MainThread* t = main(); - t->mutex.lock(); - while (t->thinking) sleepCondition.wait(t->mutex); - t->mutex.unlock(); + MainThread* th = main(); + th->mutex.lock(); + while (th->thinking) sleepCondition.wait(th->mutex); + th->mutex.unlock(); }