Small cleanups (march 2021)

With help of @BM123499, @mstembera, @gvreuls, @noobpwnftw and @Fanael
Thanks!

Closes https://github.com/official-stockfish/Stockfish/pull/3405

No functional change
This commit is contained in:
Stéphane Nicolet
2021-03-19 19:43:25 +01:00
parent ec42154ef2
commit 83eac08e75
12 changed files with 107 additions and 81 deletions

View File

@@ -128,14 +128,16 @@ void Thread::idle_loop() {
void ThreadPool::set(size_t requested) {
if (size() > 0) { // destroy any existing thread(s)
if (size() > 0) // destroy any existing thread(s)
{
main()->wait_for_search_finished();
while (size() > 0)
delete back(), pop_back();
}
if (requested > 0) { // create new thread(s)
if (requested > 0) // create new thread(s)
{
push_back(new MainThread(0));
while (size() < requested)