add EventImpl::WaitTimeoutSupported
This commit is contained in:
@@ -49,6 +49,7 @@ public:
|
||||
virtual bool Wait( RageTimer *pTimeout ) = 0;
|
||||
virtual void Signal() = 0;
|
||||
virtual void Broadcast() = 0;
|
||||
virtual bool WaitTimeoutSupported() const = 0;
|
||||
};
|
||||
|
||||
class SemaImpl
|
||||
|
||||
@@ -348,12 +348,22 @@ bool EventImpl_Pthreads::Wait( RageTimer *pTimeout )
|
||||
int iRet = pthread_cond_timedwait( &m_Cond, &m_pParent->mutex, &abstime );
|
||||
return iRet != ETIMEDOUT;
|
||||
}
|
||||
|
||||
bool EventImpl_Pthreads::WaitTimeoutSupported() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
bool EventImpl_Pthreads::Wait( RageTimer *pTimeout )
|
||||
{
|
||||
pthread_cond_wait( &m_Cond, &m_pParent->mutex );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EventImpl_Pthreads::WaitTimeoutSupported() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void EventImpl_Pthreads::Signal()
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
bool Wait( RageTimer *pTimeout );
|
||||
void Signal();
|
||||
void Broadcast();
|
||||
bool WaitTimeoutSupported() const;
|
||||
|
||||
private:
|
||||
MutexImpl_Pthreads *m_pParent;
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
bool Wait( RageTimer *pTimeout );
|
||||
void Signal();
|
||||
void Broadcast();
|
||||
bool WaitTimeoutSupported() const { return true; }
|
||||
|
||||
private:
|
||||
MutexImpl_Win32 *m_pParent;
|
||||
|
||||
Reference in New Issue
Block a user