23,124
社区成员
发帖
与我相关
我的任务
分享
void CSocketEventQueue::WaitEmpty()
{
CWrapGuard guard(_lock);
while (0 < _nEvent)
{
_emptyCond.Wait(_lock);
}
}
void CSocketEventQueue::WakeupConsumer()
{
CWrapGuard guard(_lock);
if (!_events.empty())
{
_cond.Broadcast();
}
}
void CSocketEventQueue::WakeupProductor()
{
CWrapGuard guard(_lock);
if (0 < _nEvent)
{
--_nEvent;
}
_emptyCond.Signal();
}