From fcab277ec958072aa84b148718ff30a4c4a9986b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 23 Mar 2006 21:45:53 +0000 Subject: [PATCH] keep this around as a reminder; this doesn't matter for normal clocks, but it's not good for CLOCK_MONOTONIC --- stepmania/src/arch/Threads/Threads_Pthreads.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stepmania/src/arch/Threads/Threads_Pthreads.cpp b/stepmania/src/arch/Threads/Threads_Pthreads.cpp index 8ef0d32a4e..e815f51830 100644 --- a/stepmania/src/arch/Threads/Threads_Pthreads.cpp +++ b/stepmania/src/arch/Threads/Threads_Pthreads.cpp @@ -229,6 +229,7 @@ bool EventImpl_Pthreads::Wait( RageTimer *pTimeout ) return true; } +#if 1 float fSecondsInFuture = -pTimeout->Ago(); RageTimer timeofday; @@ -244,6 +245,13 @@ bool EventImpl_Pthreads::Wait( RageTimer *pTimeout ) timespec abstime; abstime.tv_sec = timeofday.m_secs; abstime.tv_nsec = timeofday.m_us * 1000; +#else + /* XXX: This is how it should look for CLOCK_MONOTONIC: simply use the + * time directly. This requires that the condition be set to that clock, + * which requires pthread_condattr_setclock(). */ + abstime.tv_sec = pTimeout->m_secs; + abstime.tv_nsec = pTimeout->m_us * 1000; +#endif int iRet = pthread_cond_timedwait( &m_Cond, &m_pParent->mutex, &abstime ); return iRet != ETIMEDOUT;