1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Removed usage of boost::thread from vcmi, except for AI

This commit is contained in:
Ivan Savenko
2025-03-01 22:34:33 +00:00
parent 3d205e0291
commit 844dfb1604
28 changed files with 90 additions and 90 deletions

View File

@ -252,9 +252,10 @@ int CConsoleHandler::run()
cb(buffer, false);
}
else
boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
boost::this_thread::interruption_point();
if (shutdownPending)
return -1;
#else
std::getline(std::cin, buffer);
if ( cb )
@ -306,7 +307,7 @@ void CConsoleHandler::end()
if (thread.joinable())
{
#ifndef VCMI_WINDOWS
thread.interrupt();
shutdownPending = true;
#else
TerminateThread(thread.native_handle(),0);
#endif
@ -316,7 +317,7 @@ void CConsoleHandler::end()
void CConsoleHandler::start()
{
thread = boost::thread(std::bind(&CConsoleHandler::run, this));
thread = std::thread(std::bind(&CConsoleHandler::run,console));
}
VCMI_LIB_NAMESPACE_END