From 62d238d236939a05b079e364791c65882d1c1974 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 5 Jan 2013 19:51:40 +0100 Subject: [PATCH] Fixed spaces Former-commit-id: 2045fa2b37d3f0cbcd9d9d9cdcadb962ea07ecd0 --- .../Core/Posix/ConditionVariableImpl.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Nazara/Core/Posix/ConditionVariableImpl.cpp b/src/Nazara/Core/Posix/ConditionVariableImpl.cpp index 6094242b9..b5ae36333 100644 --- a/src/Nazara/Core/Posix/ConditionVariableImpl.cpp +++ b/src/Nazara/Core/Posix/ConditionVariableImpl.cpp @@ -33,15 +33,15 @@ void NzConditionVariableImpl::Wait(NzMutexImpl* mutex) bool NzConditionVariableImpl::Wait(NzMutexImpl* mutex, nzUInt32 timeout) { - // get the current time - timeval tv; - gettimeofday(&tv, NULL); + // get the current time + timeval tv; + gettimeofday(&tv, NULL); - // construct the time limit (current time + time to wait) - timespec ti; - ti.tv_nsec = (tv.tv_usec + (timeout % 1000)) * 1000000; - ti.tv_sec = tv.tv_sec + (timeout / 1000) + (ti.tv_nsec / 1000000000); - ti.tv_nsec %= 1000000000; + // construct the time limit (current time + time to wait) + timespec ti; + ti.tv_nsec = (tv.tv_usec + (timeout % 1000)) * 1000000; + ti.tv_sec = tv.tv_sec + (timeout / 1000) + (ti.tv_nsec / 1000000000); + ti.tv_nsec %= 1000000000; - pthread_cond_timedwait(&m_cv,mutex, &tv); + return pthread_cond_timedwait(&m_cv,mutex, &tv) != ETIMEDOUT; }