mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Remove Thread::WORKISWAITING
Set the state directly to Thread::SEARCHING No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
b69d9ee3f7
commit
c386ce0023
3 changed files with 2 additions and 6 deletions
|
@ -2187,12 +2187,10 @@ void Thread::idle_loop(SplitPoint* sp) {
|
|||
}
|
||||
|
||||
// If this thread has been assigned work, launch a search
|
||||
if (state == Thread::WORKISWAITING)
|
||||
if (state == Thread::SEARCHING)
|
||||
{
|
||||
assert(!do_terminate);
|
||||
|
||||
state = Thread::SEARCHING;
|
||||
|
||||
// Copy split point position and search stack and call search()
|
||||
SearchStack ss[PLY_MAX_PLUS_2];
|
||||
SplitPoint* tsp = splitPoint;
|
||||
|
|
|
@ -303,7 +303,7 @@ Value ThreadsManager::split(Position& pos, SearchStack* ss, Value alpha, Value b
|
|||
threads[i].splitPoint = sp;
|
||||
|
||||
// This makes the slave to exit from idle_loop()
|
||||
threads[i].state = Thread::WORKISWAITING;
|
||||
threads[i].state = Thread::SEARCHING;
|
||||
|
||||
if (useSleepingThreads)
|
||||
threads[i].wake_up();
|
||||
|
@ -317,7 +317,6 @@ Value ThreadsManager::split(Position& pos, SearchStack* ss, Value alpha, Value b
|
|||
|
||||
masterThread.splitPoint = sp;
|
||||
masterThread.activeSplitPoints++;
|
||||
masterThread.state = Thread::WORKISWAITING;
|
||||
|
||||
// Everything is set up. The master thread enters the idle loop, from
|
||||
// which it will instantly launch a search, because its state is
|
||||
|
|
|
@ -68,7 +68,6 @@ struct Thread {
|
|||
enum ThreadState
|
||||
{
|
||||
AVAILABLE, // Thread is waiting for work
|
||||
WORKISWAITING, // Master has ordered us to start searching
|
||||
SEARCHING // Thread is performing work
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue