[redcode/crythread-2nd-pass] removed CryEvent types
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
This commit is contained in:
@@ -14,53 +14,6 @@
|
||||
|
||||
#include "CryThread_pthreads.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// CryEvent(Timed) implementation
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryEventTimed::Reset()
|
||||
{
|
||||
m_lockNotify.Lock();
|
||||
m_flag = false;
|
||||
m_lockNotify.Unlock();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryEventTimed::Set()
|
||||
{
|
||||
m_lockNotify.Lock();
|
||||
m_flag = true;
|
||||
m_cond.Notify();
|
||||
m_lockNotify.Unlock();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryEventTimed::Wait()
|
||||
{
|
||||
m_lockNotify.Lock();
|
||||
if (!m_flag)
|
||||
{
|
||||
m_cond.Wait(m_lockNotify);
|
||||
}
|
||||
m_flag = false;
|
||||
m_lockNotify.Unlock();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CryEventTimed::Wait(const uint32 timeoutMillis)
|
||||
{
|
||||
bool bResult = true;
|
||||
m_lockNotify.Lock();
|
||||
if (!m_flag)
|
||||
{
|
||||
bResult = m_cond.TimedWait(m_lockNotify, timeoutMillis);
|
||||
}
|
||||
m_flag = false;
|
||||
m_lockNotify.Unlock();
|
||||
return bResult;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// CryCriticalSection implementation
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -12,45 +12,6 @@
|
||||
#include <AzCore/PlatformIncl.h>
|
||||
#include <AzCore/std/parallel/semaphore.h> // for CreateSemaphore
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CryEvent::CryEvent()
|
||||
{
|
||||
m_handle = (void*)CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CryEvent::~CryEvent()
|
||||
{
|
||||
CloseHandle(m_handle);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryEvent::Reset()
|
||||
{
|
||||
ResetEvent(m_handle);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryEvent::Set()
|
||||
{
|
||||
SetEvent(m_handle);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryEvent::Wait() const
|
||||
{
|
||||
WaitForSingleObject(m_handle, INFINITE);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CryEvent::Wait(const uint32 timeoutMillis) const
|
||||
{
|
||||
if (WaitForSingleObject(m_handle, timeoutMillis) == WAIT_TIMEOUT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// CryLock_WinMutex
|
||||
|
||||
@@ -619,38 +619,4 @@ struct SCryPthreadTLS
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// CryEvent(Timed) represent a synchronization event
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class CryEventTimed
|
||||
{
|
||||
public:
|
||||
ILINE CryEventTimed(){m_flag = false; }
|
||||
ILINE ~CryEventTimed(){}
|
||||
|
||||
// Reset the event to the unsignalled state.
|
||||
void Reset();
|
||||
// Set the event to the signalled state.
|
||||
void Set();
|
||||
// Access a HANDLE to wait on.
|
||||
void* GetHandle() const { return NULL; };
|
||||
// Wait indefinitely for the object to become signalled.
|
||||
void Wait();
|
||||
// Wait, with a time limit, for the object to become signalled.
|
||||
bool Wait(const uint32 timeoutMillis);
|
||||
|
||||
private:
|
||||
// Lock for synchronization of notifications.
|
||||
CryCriticalSection m_lockNotify;
|
||||
#if defined(LINUX) || defined(APPLE)
|
||||
CryConditionVariableT< CryLockT<CRYLOCK_RECURSIVE> > m_cond;
|
||||
#else
|
||||
CryConditionVariable m_cond;
|
||||
#endif
|
||||
volatile bool m_flag;
|
||||
};
|
||||
|
||||
typedef CryEventTimed CryEvent;
|
||||
|
||||
#include "MemoryAccess.h"
|
||||
|
||||
@@ -17,36 +17,6 @@
|
||||
#define CRYTHREAD_WINDOWS_H_SECTION_2 2
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// CryEvent represent a synchronization event
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class CryEvent
|
||||
{
|
||||
public:
|
||||
CryEvent();
|
||||
~CryEvent();
|
||||
|
||||
// Reset the event to the unsignalled state.
|
||||
void Reset();
|
||||
// Set the event to the signalled state.
|
||||
void Set();
|
||||
// Access a HANDLE to wait on.
|
||||
void* GetHandle() const { return m_handle; };
|
||||
// Wait indefinitely for the object to become signalled.
|
||||
void Wait() const;
|
||||
// Wait, with a time limit, for the object to become signalled.
|
||||
bool Wait(const uint32 timeoutMillis) const;
|
||||
|
||||
private:
|
||||
CryEvent(const CryEvent&);
|
||||
CryEvent& operator = (const CryEvent&);
|
||||
|
||||
private:
|
||||
void* m_handle;
|
||||
};
|
||||
|
||||
typedef CryEvent CryEventTimed;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user