Start sfen reader worker thread in the constructor.

This commit is contained in:
Tomasz Sobczyk
2020-10-22 14:43:38 +02:00
committed by nodchip
parent 0636e1256d
commit c58aa9696a
2 changed files with 4 additions and 11 deletions
+4 -8
View File
@@ -53,6 +53,10 @@ namespace Learner{
end_of_files = false;
shuffle = true;
stop_flag = false;
file_worker_thread = std::thread([&] {
this->file_read_worker();
});
}
~SfenReader()
@@ -176,14 +180,6 @@ namespace Learner{
}
// Start a thread that loads the phase file in the background.
void start_file_read_worker()
{
file_worker_thread = std::thread([&] {
this->file_read_worker();
});
}
void file_read_worker()
{
std::string currentFilename;