10 #ifndef __PION_SHUTDOWNMANAGER_HEADER__
11 #define __PION_SHUTDOWNMANAGER_HEADER__
13 #include <boost/thread/mutex.hpp>
14 #include <boost/thread/condition.hpp>
31 boost::mutex::scoped_lock shutdown_lock(m_shutdown_mutex);
32 m_shutdown_now =
true;
33 m_shutdown_cond.notify_all();
38 boost::mutex::scoped_lock shutdown_lock(m_shutdown_mutex);
39 while (! m_shutdown_now)
40 m_shutdown_cond.wait(shutdown_lock);
48 boost::mutex m_shutdown_mutex;
51 boost::condition m_shutdown_cond;
60 BOOL WINAPI console_ctrl_handler(DWORD ctrl_type)
64 case CTRL_BREAK_EVENT:
65 case CTRL_CLOSE_EVENT:
66 case CTRL_SHUTDOWN_EVENT:
74 void handle_signal(
int sig)