mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user