30 static thread_local unique_ptr<boost::asio::io_service>
g_ioService;
35 boost::asio::io_service&
38 if (g_ioService ==
nullptr) {
39 g_ioService = make_unique<boost::asio::io_service>();
47 if (g_scheduler ==
nullptr) {
55 resetGlobalIoService()
62 boost::asio::io_service&
65 BOOST_ASSERT(g_mainIoService !=
nullptr);
69 boost::asio::io_service&
72 BOOST_ASSERT(g_ribIoService !=
nullptr);
79 g_mainIoService = mainIo;
85 g_ribIoService = ribIo;
static boost::asio::io_service * g_ribIoService
void runOnRibIoService(const std::function< void()> &f)
Run a function on the RIB io_service instance.
void setMainIoService(boost::asio::io_service *mainIo)
void runOnMainIoService(const std::function< void()> &f)
Run a function on the main io_service instance.
boost::asio::io_service & getMainIoService()
Scheduler & getScheduler()
Returns the global Scheduler instance for the calling thread.
boost::asio::io_service & getRibIoService()
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
static thread_local unique_ptr< boost::asio::io_service > g_ioService
static boost::asio::io_service * g_mainIoService
static thread_local unique_ptr< Scheduler > g_scheduler
void setRibIoService(boost::asio::io_service *ribIo)
boost::asio::io_service & getGlobalIoService()
Returns the global io_service instance for the calling thread.