Remove unused IoBoundWorkSlot

This commit is contained in:
Alexander A. Klimov 2024-02-07 10:59:49 +01:00
parent 3d5e031adf
commit eb4e601eaf
2 changed files with 0 additions and 43 deletions

View File

@ -50,29 +50,6 @@ void CpuBoundWork::Done()
} }
} }
IoBoundWorkSlot::IoBoundWorkSlot(boost::asio::yield_context yc)
: yc(yc)
{
IoEngine::Get().m_CpuBoundSemaphore.fetch_add(1);
}
IoBoundWorkSlot::~IoBoundWorkSlot()
{
auto& ioEngine (IoEngine::Get());
for (;;) {
auto availableSlots (ioEngine.m_CpuBoundSemaphore.fetch_sub(1));
if (availableSlots < 1) {
ioEngine.m_CpuBoundSemaphore.fetch_add(1);
IoEngine::YieldCurrentCoroutine(yc);
continue;
}
break;
}
}
LazyInit<std::unique_ptr<IoEngine>> IoEngine::m_Instance ([]() { return std::unique_ptr<IoEngine>(new IoEngine()); }); LazyInit<std::unique_ptr<IoEngine>> IoEngine::m_Instance ([]() { return std::unique_ptr<IoEngine>(new IoEngine()); });
IoEngine& IoEngine::Get() IoEngine& IoEngine::Get()

View File

@ -50,25 +50,6 @@ private:
bool m_Done; bool m_Done;
}; };
/**
* Scope break for CPU-bound work done in an I/O thread
*
* @ingroup base
*/
class IoBoundWorkSlot
{
public:
IoBoundWorkSlot(boost::asio::yield_context yc);
IoBoundWorkSlot(const IoBoundWorkSlot&) = delete;
IoBoundWorkSlot(IoBoundWorkSlot&&) = delete;
IoBoundWorkSlot& operator=(const IoBoundWorkSlot&) = delete;
IoBoundWorkSlot& operator=(IoBoundWorkSlot&&) = delete;
~IoBoundWorkSlot();
private:
boost::asio::yield_context yc;
};
/** /**
* Async I/O engine * Async I/O engine
* *
@ -77,7 +58,6 @@ private:
class IoEngine class IoEngine
{ {
friend CpuBoundWork; friend CpuBoundWork;
friend IoBoundWorkSlot;
public: public:
IoEngine(const IoEngine&) = delete; IoEngine(const IoEngine&) = delete;