aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-11-24 12:53:35 +0200
committerRiccardo Spagni <ric@spagni.net>2016-11-24 12:53:35 +0200
commit52175502de2dccd22d7efb145603ed1629417284 (patch)
tree5746f0cbec4c2934605372271c6b78cc2285f7d1
parentMerge pull request #1352 (diff)
parentepee: blind attempt to fix exit hang on windows (diff)
downloadmonero-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.h14
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;