10 #include <boost/date_time/posix_time/posix_time_duration.hpp>
11 #include <pion/PionScheduler.hpp>
29 boost::mutex::scoped_lock scheduler_lock(
m_mutex);
33 PION_LOG_INFO(
m_logger,
"Shutting down the thread scheduler");
48 PION_LOG_INFO(
m_logger,
"The thread scheduler has shutdown");
69 boost::mutex::scoped_lock scheduler_lock(
m_mutex);
77 boost::asio::deadline_timer& my_timer)
83 boost::ref(my_service), boost::ref(my_timer)));
90 boost::mutex::scoped_lock scheduler_lock(
m_mutex);
96 boost::mutex::scoped_lock scheduler_lock(
m_mutex);
102 boost::uint32_t sleep_nsec)
104 boost::xtime wakeup_time;
106 boost::xtime_get(&wakeup_time, TIME_UTC);
108 boost::xtime_get(&wakeup_time, boost::TIME_UTC);
110 wakeup_time.sec += sleep_sec;
111 wakeup_time.nsec += sleep_nsec;
112 if (static_cast<boost::uint32_t>(wakeup_time.nsec) >=
NSEC_IN_SECOND) {
123 }
catch (std::exception& e) {
126 PION_LOG_ERROR(
m_logger,
"caught unrecognized exception");
137 boost::mutex::scoped_lock scheduler_lock(
m_mutex);
140 PION_LOG_INFO(
m_logger,
"Starting thread scheduler");
162 boost::mutex::scoped_lock scheduler_lock(
m_mutex);
165 PION_LOG_INFO(
m_logger,
"Starting thread scheduler");
170 boost::shared_ptr<ServicePair> service_ptr(
new ServicePair());