From b14751aad9236a07300cc4a945a424126f2cc53d Mon Sep 17 00:00:00 2001 From: Donovan Hide Date: Wed, 19 Nov 2014 19:17:08 +0000 Subject: [PATCH] Use asio signal handling in Application (RIPD-140): * Use signal_set as cross platform way of handling SIGINT * Remove polling on main thread for shutdown. * Add extra logging for received signal. * Clean up exit handling on error in setup routines. * Reuse isStopped() from Stoppable for status (could be isStopping() instead). * Ctrl-C should now work for standalone mode as well on Windows. Also small fixes to Resolver: * Add Resolver prefix to logging. * Fix AsyncObject::removeReference() logic. * Fix work remaining logic. --- beast/module/asio/AsyncObject.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beast/module/asio/AsyncObject.h b/beast/module/asio/AsyncObject.h index 38d8e15fca..07c7fe4e44 100644 --- a/beast/module/asio/AsyncObject.h +++ b/beast/module/asio/AsyncObject.h @@ -83,8 +83,8 @@ public: void removeReference () { - if (--m_pending) - (static_cast (this))->asyncHandlersComplete (); + if (--m_pending == 0) + (static_cast(this))->asyncHandlersComplete(); } private: