diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-11-24 12:53:35 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-11-24 12:53:35 +0200 |
commit | 52175502de2dccd22d7efb145603ed1629417284 (patch) | |
tree | 5746f0cbec4c2934605372271c6b78cc2285f7d1 | |
parent | Merge pull request #1352 (diff) | |
parent | epee: blind attempt to fix exit hang on windows (diff) | |
download | monero-52175502de2dccd22d7efb145603ed1629417284.tar.xz |
Merge pull request #1353
452aeca epee: blind attempt to fix exit hang on windows (moneromooo-monero)
-rw-r--r-- | contrib/epee/include/console_handler.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h index 95b986ff5..2ad92b3f2 100644 --- a/contrib/epee/include/console_handler.h +++ b/contrib/epee/include/console_handler.h @@ -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; |