aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-17 22:08:32 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-17 22:10:03 +0000
commit452aeca5cd0d0cdb0e776f907527a68d8cc9b1ca (patch)
tree0ad3fff454ada83f7d8c8faec5fc89d05eff0858 /contrib
parentMerge pull request #1346 (diff)
downloadmonero-452aeca5cd0d0cdb0e776f907527a68d8cc9b1ca.tar.xz
epee: blind attempt to fix exit hang on windows
Thanks to duckduckgo and the internet. This might even compile.
Diffstat (limited to 'contrib')
-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;