From bde99d684e0bb51adaa053a240abe61cf4af07fb Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 20 Oct 2014 18:59:40 +0100 Subject: Migrated cSleep and cTimer to std::chrono --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 86ecd4000..b1cfd6976 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -160,7 +160,10 @@ BOOL CtrlHandler(DWORD fdwCtrlType) if (fdwCtrlType == CTRL_CLOSE_EVENT) // Console window closed via 'x' button, Windows will try to close immediately, therefore... { - while (!g_ServerTerminated) { cSleep::MilliSleep(100); } // Delay as much as possible to try to get the server to shut down cleanly + while (!g_ServerTerminated) + { + std::this_thread::sleep_for(std::chrono::milliseconds(50)); // Delay as much as possible to try to get the server to shut down cleanly + } } return TRUE; -- cgit v1.2.3