thread: Remove searchStarted()/searchFinished()/act()

This commit is contained in:
Calcitem 2020-10-17 22:32:08 +08:00
parent 3f707ff5cd
commit fb6dd70562
2 changed files with 10 additions and 22 deletions

View File

@ -147,7 +147,6 @@ void Thread::idle_loop()
if (exit)
return;
emit searchStarted();
lk.unlock();
// TODO: Stockfish doesn't have this
@ -179,8 +178,6 @@ void Thread::idle_loop()
#ifdef OPENING_BOOK
}
#endif
emit searchFinished();
}
loggerDebug("Thread %d quit\n", us);
@ -189,15 +186,6 @@ void Thread::idle_loop()
///////////////
void Thread::act()
{
if (exit|| !searching)
return;
std::lock_guard<std::mutex> lk(mutex);
clearHistoryScore();
}
void Thread::setAi(Position *p)
{
std::lock_guard<std::mutex> lk(mutex);
@ -218,10 +206,12 @@ void Thread::setAi(Position *p, int tl)
timeLimit = tl;
}
#ifdef QT_UI
void Thread::emitCommand()
{
emit command(strCommand);
}
#endif // QT_UI
#ifdef OPENING_BOOK
deque<int> openingBookDeque(

View File

@ -58,6 +58,7 @@ public:
int search();
void clear();
void idle_loop();
void start_searching();
void wait_for_search_finished();
int best_move_count(Move move) const;
@ -138,21 +139,18 @@ public:
int us;
Q_OBJECT
private:
int timeLimit;
Q_OBJECT
public:
#ifdef QT_UI
void emitCommand();
#endif // QT_UI
signals:
void command(const string &cmdline, bool update = true);
void searchStarted();
void searchFinished();
public slots:
void act(); // Force move, not quit thread
void start_searching();
void emitCommand();
};