Skip to content

Commit 390ee30

Browse files
committed
Remove unused IoBoundWorkSlot
1 parent ab922b4 commit 390ee30

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

lib/base/io-engine.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,6 @@ void CpuBoundWork::Done()
5050
}
5151
}
5252

53-
IoBoundWorkSlot::IoBoundWorkSlot(boost::asio::yield_context yc)
54-
: yc(yc)
55-
{
56-
IoEngine::Get().m_CpuBoundSemaphore.fetch_add(1);
57-
}
58-
59-
IoBoundWorkSlot::~IoBoundWorkSlot()
60-
{
61-
auto& ioEngine (IoEngine::Get());
62-
63-
for (;;) {
64-
auto availableSlots (ioEngine.m_CpuBoundSemaphore.fetch_sub(1));
65-
66-
if (availableSlots < 1) {
67-
ioEngine.m_CpuBoundSemaphore.fetch_add(1);
68-
IoEngine::YieldCurrentCoroutine(yc);
69-
continue;
70-
}
71-
72-
break;
73-
}
74-
}
75-
7653
LazyInit<std::unique_ptr<IoEngine>> IoEngine::m_Instance ([]() { return std::unique_ptr<IoEngine>(new IoEngine()); });
7754

7855
IoEngine& IoEngine::Get()

lib/base/io-engine.hpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,6 @@ class CpuBoundWork
5050
bool m_Done;
5151
};
5252

53-
/**
54-
* Scope break for CPU-bound work done in an I/O thread
55-
*
56-
* @ingroup base
57-
*/
58-
class IoBoundWorkSlot
59-
{
60-
public:
61-
IoBoundWorkSlot(boost::asio::yield_context yc);
62-
IoBoundWorkSlot(const IoBoundWorkSlot&) = delete;
63-
IoBoundWorkSlot(IoBoundWorkSlot&&) = delete;
64-
IoBoundWorkSlot& operator=(const IoBoundWorkSlot&) = delete;
65-
IoBoundWorkSlot& operator=(IoBoundWorkSlot&&) = delete;
66-
~IoBoundWorkSlot();
67-
68-
private:
69-
boost::asio::yield_context yc;
70-
};
71-
7253
/**
7354
* Async I/O engine
7455
*
@@ -77,7 +58,6 @@ class IoBoundWorkSlot
7758
class IoEngine
7859
{
7960
friend CpuBoundWork;
80-
friend IoBoundWorkSlot;
8161

8262
public:
8363
IoEngine(const IoEngine&) = delete;

0 commit comments

Comments
 (0)