Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header. Failure to run a real thread is handled gracefully.
This commit is contained in:
@@ -73,6 +73,7 @@ static void DedicatedSignalHandler(int sig)
|
||||
# include <time.h>
|
||||
# include <tchar.h>
|
||||
# include "../os/windows/win32.h"
|
||||
# include "../thread.h"
|
||||
static HANDLE _hInputReady, _hWaitForInputHandling;
|
||||
static HANDLE _hThread; // Thread to close
|
||||
static char _win_console_thread_buffer[200];
|
||||
@@ -80,7 +81,7 @@ static char _win_console_thread_buffer[200];
|
||||
/* Windows Console thread. Just loop and signal when input has been received */
|
||||
static void WINAPI CheckForConsoleInput()
|
||||
{
|
||||
SetWin32ThreadName(-1, "ottd:win-console");
|
||||
SetCurrentThreadName("ottd:win-console");
|
||||
|
||||
DWORD nb;
|
||||
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
Reference in New Issue
Block a user