Rework Thread hierarchy

Introduce ThreadBase struct that is search
agnostic and just handles low level stuff,
and derive all the other specialized classes
form here.

In particular TimerThread does not hinerits
anymore all the search related stuff from Thread.

Also some renaming while there.

Suggested by Steven Edwards

No functional change.
This commit is contained in:
Marco Costalba
2013-07-31 09:33:26 +02:00
parent 4d46d29efe
commit 55948623e7
5 changed files with 56 additions and 46 deletions

View File

@@ -56,7 +56,7 @@ namespace {
void UCI::loop(const string& args) {
Position pos(StartFEN, false, Threads.main_thread()); // The root position
Position pos(StartFEN, false, Threads.main()); // The root position
string token, cmd = args;
do {
@@ -77,7 +77,7 @@ void UCI::loop(const string& args) {
if (token != "ponderhit" || Search::Signals.stopOnPonderhit)
{
Search::Signals.stop = true;
Threads.main_thread()->notify_one(); // Could be sleeping
Threads.main()->notify_one(); // Could be sleeping
}
else
Search::Limits.ponder = false;
@@ -146,7 +146,7 @@ namespace {
else
return;
pos.set(fen, Options["UCI_Chess960"], Threads.main_thread());
pos.set(fen, Options["UCI_Chess960"], Threads.main());
SetupStates = Search::StateStackPtr(new std::stack<StateInfo>());
// Parse move list (if any)