epee: blind attempt to fix exit hang on windows

Thanks to duckduckgo and the internet.

This might even compile.
This commit is contained in:
moneromooo-monero 2016-11-17 22:08:32 +00:00
parent dbf2ab56c5
commit 452aeca5cd
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

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;