Scheduler and time are imported from ndn-cpp-dev. Forwarder is using the new scheduler API. Face system is not transitioned yet. refs #1290 Change-Id: I5679cb50bbf9890a105f663b038f13951403c2b6
36 lines
680 B
C++
36 lines
680 B
C++
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
/**
|
|
* Copyright (C) 2014 Named Data Networking Project
|
|
* See COPYING for copyright and distribution information.
|
|
*/
|
|
|
|
#include "global-io.hpp"
|
|
|
|
namespace nfd {
|
|
|
|
namespace scheduler {
|
|
// defined in scheduler.cpp
|
|
void
|
|
resetGlobalScheduler();
|
|
} // namespace scheduler
|
|
|
|
static shared_ptr<boost::asio::io_service> g_ioService;
|
|
|
|
boost::asio::io_service&
|
|
getGlobalIoService()
|
|
{
|
|
if (!static_cast<bool>(g_ioService)) {
|
|
g_ioService = make_shared<boost::asio::io_service>();
|
|
}
|
|
return *g_ioService;
|
|
}
|
|
|
|
void
|
|
resetGlobalIoService()
|
|
{
|
|
scheduler::resetGlobalScheduler();
|
|
g_ioService.reset();
|
|
}
|
|
|
|
} // namespace nfd
|