mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
42 lines
907 B
C++
42 lines
907 B
C++
//------------------------------------------------------------------------------
|
|
/*
|
|
Copyright (c) 2011-2013, OpenCoin, Inc.
|
|
*/
|
|
//==============================================================================
|
|
|
|
AsyncService::AsyncService (char const* name, Service& parent)
|
|
: Service (name, parent)
|
|
{
|
|
}
|
|
|
|
AsyncService::~AsyncService ()
|
|
{
|
|
// If this goes off it means the
|
|
// AsyncService API contract was violated.
|
|
//
|
|
bassert (m_pendingIo.get() == 0);
|
|
}
|
|
|
|
void AsyncService::serviceCountIoPending ()
|
|
{
|
|
++m_pendingIo;
|
|
}
|
|
|
|
bool AsyncService::serviceCountIoComplete (boost::system::error_code const& ec)
|
|
{
|
|
// If this goes off, the count is unbalanced.
|
|
bassert (m_pendingIo.get() > 0);
|
|
|
|
--m_pendingIo;
|
|
|
|
if (! ec || ec == boost::asio::error::operation_aborted)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
void AsyncService::onServiceIoComplete ()
|
|
{
|
|
//serviceStopped();
|
|
}
|