Add a generic worker thread pool job executor mechanism

This commit is contained in:
Jonathan G Rennison
2022-11-09 21:57:05 +00:00
parent ee2763dcfd
commit 07b752fe69
4 changed files with 144 additions and 0 deletions

View File

@@ -84,6 +84,7 @@
#include "debug_desync.h"
#include "event_logs.h"
#include "tunnelbridge.h"
#include "worker_thread.h"
#include "linkgraph/linkgraphschedule.h"
#include "tracerestrict.h"
@@ -991,8 +992,12 @@ int openttd_main(int argc, char *argv[])
/* ScanNewGRFFiles now has control over the scanner. */
RequestNewGRFScan(scanner.release());
_general_worker_pool.Start("ottd:worker", 8);
VideoDriver::GetInstance()->MainLoop();
_general_worker_pool.Stop();
WaitTillSaved();
/* only save config if we have to */