mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Introduce IoEngine::YieldCurrentCoroutine()
This commit is contained in:
parent
732d5c472d
commit
9585a63fa0
@ -25,7 +25,7 @@ CpuBoundWork::CpuBoundWork(boost::asio::yield_context yc)
|
|||||||
|
|
||||||
if (availableSlots < 1) {
|
if (availableSlots < 1) {
|
||||||
ioEngine.m_CpuBoundSemaphore.fetch_add(1);
|
ioEngine.m_CpuBoundSemaphore.fetch_add(1);
|
||||||
ioEngine.m_AlreadyExpiredTimer.async_wait(yc);
|
IoEngine::YieldCurrentCoroutine(yc);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ IoBoundWorkSlot::~IoBoundWorkSlot()
|
|||||||
|
|
||||||
if (availableSlots < 1) {
|
if (availableSlots < 1) {
|
||||||
ioEngine.m_CpuBoundSemaphore.fetch_add(1);
|
ioEngine.m_CpuBoundSemaphore.fetch_add(1);
|
||||||
ioEngine.m_AlreadyExpiredTimer.async_wait(yc);
|
IoEngine::YieldCurrentCoroutine(yc);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +119,12 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline
|
||||||
|
void YieldCurrentCoroutine(boost::asio::yield_context yc)
|
||||||
|
{
|
||||||
|
Get().m_AlreadyExpiredTimer.async_wait(yc);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IoEngine();
|
IoEngine();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user