Removed unused parameter
This commit is contained in:
parent
cb2965991f
commit
3661e835f8
2 changed files with 7 additions and 18 deletions
|
|
@ -72,7 +72,7 @@ namespace asio {
|
||||||
* This IO service is automatically running in its own thread to service asynchronous
|
* This IO service is automatically running in its own thread to service asynchronous
|
||||||
* requests without blocking any other threads.
|
* requests without blocking any other threads.
|
||||||
*/
|
*/
|
||||||
boost::asio::io_service& default_io_service(bool cleanup = false);
|
boost::asio::io_service& default_io_service();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief wraps boost::asio::async_read
|
* @brief wraps boost::asio::async_read
|
||||||
|
|
|
||||||
23
src/asio.cpp
23
src/asio.cpp
|
|
@ -99,7 +99,6 @@ namespace fc {
|
||||||
|
|
||||||
default_io_service_scope()
|
default_io_service_scope()
|
||||||
{
|
{
|
||||||
cleanup_complete = false;
|
|
||||||
io = new boost::asio::io_service();
|
io = new boost::asio::io_service();
|
||||||
the_work = new boost::asio::io_service::work(*io);
|
the_work = new boost::asio::io_service::work(*io);
|
||||||
for( int i = 0; i < 8; ++i ) {
|
for( int i = 0; i < 8; ++i ) {
|
||||||
|
|
@ -136,7 +135,7 @@ namespace fc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup()
|
~default_io_service_scope()
|
||||||
{
|
{
|
||||||
delete the_work;
|
delete the_work;
|
||||||
io->stop();
|
io->stop();
|
||||||
|
|
@ -147,25 +146,15 @@ namespace fc {
|
||||||
for( auto asio_thread : asio_threads ) {
|
for( auto asio_thread : asio_threads ) {
|
||||||
delete asio_thread;
|
delete asio_thread;
|
||||||
}
|
}
|
||||||
cleanup_complete = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~default_io_service_scope()
|
|
||||||
{
|
|
||||||
if (!cleanup_complete)
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
bool cleanup_complete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// If cleanup is true, do not use the return value; it is a null reference
|
/***
|
||||||
boost::asio::io_service& default_io_service(bool cleanup) {
|
* @brief create an io_service
|
||||||
|
* @returns the io_service
|
||||||
|
*/
|
||||||
|
boost::asio::io_service& default_io_service() {
|
||||||
static default_io_service_scope fc_asio_service[1];
|
static default_io_service_scope fc_asio_service[1];
|
||||||
if (cleanup) {
|
|
||||||
for( int i = 0; i < 1; ++i )
|
|
||||||
fc_asio_service[i].cleanup();
|
|
||||||
}
|
|
||||||
return *fc_asio_service[0].io;
|
return *fc_asio_service[0].io;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue