Fixed cEvent TimedWait on Linux.
This commit is contained in:
parent
0575cc00b4
commit
53455a10fa
@ -141,7 +141,7 @@ cEvent::eWaitResult cEvent::Wait(int a_TimeoutMilliSec)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
timespec timeout;
|
timespec timeout;
|
||||||
timeout.tv_sec = a_TimeoutMilliSec / 1000;
|
timeout.tv_sec = time(NULL) + a_TimeoutMilliSec / 1000;
|
||||||
timeout.tv_nsec = (a_TimeoutMilliSec % 1000) * 1000000;
|
timeout.tv_nsec = (a_TimeoutMilliSec % 1000) * 1000000;
|
||||||
int res = sem_timedwait(m_Event, &timeout);
|
int res = sem_timedwait(m_Event, &timeout);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user