当前位置: 技术问答>linux和unix
linux下如何实现 类似Windows的WaitForMultipleObjects函数的功能
来源: 互联网 发布时间:2016-02-29
本文导语: 代码如下: HANDLE handles[2] = {m_quitEvent.GetHandle(), m_semaphore.GetHandle()}; UInt32 uWait = WaitForMultipleObjects(2, handles, False, MAX_TIMEOUT); if(uWait - WAIT_OBJECT_0 == 0) { //退出信号 break; } Linux代码如何实现呢? ...
代码如下:
HANDLE handles[2] = {m_quitEvent.GetHandle(), m_semaphore.GetHandle()};
UInt32 uWait = WaitForMultipleObjects(2, handles, False, MAX_TIMEOUT);
if(uWait - WAIT_OBJECT_0 == 0)
{
//退出信号
break;
}
Linux代码如何实现呢?
HANDLE handles[2] = {m_quitEvent.GetHandle(), m_semaphore.GetHandle()};
UInt32 uWait = WaitForMultipleObjects(2, handles, False, MAX_TIMEOUT);
if(uWait - WAIT_OBJECT_0 == 0)
{
//退出信号
break;
}
Linux代码如何实现呢?
|
sig_wait可以不?