From 08ddf9af778e78d7c1ee5f6c0de78f51104b7d66 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 26 Jan 2005 21:13:50 +0000 Subject: [PATCH] fix up EventImpl_Pthreads::Wait --- stepmania/src/arch/Threads/Threads_Pthreads.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/stepmania/src/arch/Threads/Threads_Pthreads.cpp b/stepmania/src/arch/Threads/Threads_Pthreads.cpp index 867d8e4051..7fd73f1c4d 100644 --- a/stepmania/src/arch/Threads/Threads_Pthreads.cpp +++ b/stepmania/src/arch/Threads/Threads_Pthreads.cpp @@ -1,5 +1,6 @@ #include "global.h" #include "Threads_Pthreads.h" +#include "RageTimer.h" #include "RageUtil.h" #include #include @@ -215,6 +216,7 @@ EventImpl_Pthreads::~EventImpl_Pthreads() pthread_cond_destroy( &m_Cond ); } +#if defined(HAVE_PTHREAD_COND_TIMEDWAIT) bool EventImpl_Pthreads::Wait( RageTimer *pTimeout ) { if( pTimeout == NULL ) @@ -224,11 +226,19 @@ bool EventImpl_Pthreads::Wait( RageTimer *pTimeout ) } timespec abstime; - timeout.tv_sec = pTimeout->m_secs; - timeout.tv_nsec = pTimeout->m_us * 1000; - int iRet = pthread_cond_timedwait( &m_Cond, &m_pParent->mutex ); + abstime.tv_sec = pTimeout->m_secs; + abstime.tv_nsec = pTimeout->m_us * 1000; + int iRet = pthread_cond_timedwait( &m_Cond, &m_pParent->mutex, &abstime ); return iRet != ETIMEDOUT; } +#else +sdf +bool EventImpl_Pthreads::Wait( RageTimer *pTimeout ) +{ + pthread_cond_wait( &m_Cond, &m_pParent->mutex ); + return true; +} +#endif void EventImpl_Pthreads::Signal() {