RageEvent
This commit is contained in:
@@ -653,6 +653,35 @@ void LockMutex::Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
RageEvent::RageEvent( CString name ):
|
||||
RageMutex(name)
|
||||
{
|
||||
m_pEvent = MakeEvent( m_pMutex );
|
||||
}
|
||||
|
||||
RageEvent::~RageEvent()
|
||||
{
|
||||
delete m_pEvent;
|
||||
}
|
||||
|
||||
void RageEvent::Wait()
|
||||
{
|
||||
ASSERT( IsLockedByThisThread() );
|
||||
m_pEvent->Wait();
|
||||
}
|
||||
|
||||
void RageEvent::Signal()
|
||||
{
|
||||
ASSERT( IsLockedByThisThread() );
|
||||
m_pEvent->Signal();
|
||||
}
|
||||
|
||||
void RageEvent::Broadcast()
|
||||
{
|
||||
ASSERT( IsLockedByThisThread() );
|
||||
m_pEvent->Broadcast();
|
||||
}
|
||||
|
||||
RageSemaphore::RageSemaphore( CString sName, int iInitialValue ):
|
||||
m_sName( sName )
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
RageMutex( CString name );
|
||||
virtual ~RageMutex();
|
||||
|
||||
private:
|
||||
protected:
|
||||
MutexImpl *m_pMutex;
|
||||
CString m_sName;
|
||||
|
||||
@@ -130,6 +130,21 @@ public:
|
||||
#define LockMut(m) LockMutex LocalLock(m, __FUNCTION__, __LINE__)
|
||||
#endif
|
||||
|
||||
class EventImpl;
|
||||
class RageEvent: public RageMutex
|
||||
{
|
||||
public:
|
||||
RageEvent( CString name );
|
||||
~RageEvent();
|
||||
|
||||
void Wait();
|
||||
void Signal();
|
||||
void Broadcast();
|
||||
|
||||
private:
|
||||
EventImpl *m_pEvent;
|
||||
};
|
||||
|
||||
class SemaImpl;
|
||||
class RageSemaphore
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user