Fixed spaces
Former-commit-id: 2045fa2b37d3f0cbcd9d9d9cdcadb962ea07ecd0
This commit is contained in:
parent
e6198f6b3d
commit
62d238d236
|
|
@ -33,15 +33,15 @@ void NzConditionVariableImpl::Wait(NzMutexImpl* mutex)
|
||||||
|
|
||||||
bool NzConditionVariableImpl::Wait(NzMutexImpl* mutex, nzUInt32 timeout)
|
bool NzConditionVariableImpl::Wait(NzMutexImpl* mutex, nzUInt32 timeout)
|
||||||
{
|
{
|
||||||
// get the current time
|
// get the current time
|
||||||
timeval tv;
|
timeval tv;
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
|
|
||||||
// construct the time limit (current time + time to wait)
|
// construct the time limit (current time + time to wait)
|
||||||
timespec ti;
|
timespec ti;
|
||||||
ti.tv_nsec = (tv.tv_usec + (timeout % 1000)) * 1000000;
|
ti.tv_nsec = (tv.tv_usec + (timeout % 1000)) * 1000000;
|
||||||
ti.tv_sec = tv.tv_sec + (timeout / 1000) + (ti.tv_nsec / 1000000000);
|
ti.tv_sec = tv.tv_sec + (timeout / 1000) + (ti.tv_nsec / 1000000000);
|
||||||
ti.tv_nsec %= 1000000000;
|
ti.tv_nsec %= 1000000000;
|
||||||
|
|
||||||
pthread_cond_timedwait(&m_cv,mutex, &tv);
|
return pthread_cond_timedwait(&m_cv,mutex, &tv) != ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue