Merge pull request #1353

452aeca epee: blind attempt to fix exit hang on windows (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2016-11-24 12:53:35 +02:00
commit 52175502de
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

View File

@ -155,6 +155,20 @@ namespace epee
else if (0 < retval)
return true;
}
#else
while (m_run.load(std::memory_order_relaxed))
{
int retval = ::WaitForSingleObject(::GetStdHandle(STD_INPUT_HANDLE), 100);
switch (retval)
{
case WAIT_FAILED:
return false;
case WAIT_OBJECT_0:
return true;
default:
break;
}
}
#endif
return true;