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