From 590eea770f085ab32dc43940037e393cf6c6be71 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 10 Mar 2012 16:09:03 -0800 Subject: [PATCH] Remove CEvent entirely. --- .../NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp | 41 ------------------- Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h | 37 ----------------- 2 files changed, 78 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp index e5100e52..dadc167b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp @@ -316,47 +316,6 @@ void CLock::LeaveWrite () { } -/***************************************************************************** -* -* CEvent -* -***/ - -//============================================================================ -CEvent::CEvent ( - ECEventResetBehavior resetType, - bool initialSet -) { - m_handle = CreateEvent( - nil, // security attributes - (resetType == kEventManualReset) ? true : false, - initialSet, - nil // name - ); -} - -//============================================================================ -CEvent::~CEvent () { - (void) CloseHandle(m_handle); -} - -//============================================================================ -void CEvent::Signal () { - SetEvent(m_handle); -} - -//============================================================================ -void CEvent::Reset () { - ResetEvent(m_handle); -} - -//============================================================================ -bool CEvent::Wait (unsigned waitMs) { - ThreadAssertCanBlock(__FILE__, __LINE__); - return WaitForSingleObject(m_handle, waitMs) == WAIT_OBJECT_0; -} - - /**************************************************************************** * * Exported functions diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h index 750b5bb7..8a22497b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h @@ -95,41 +95,4 @@ public: void LeaveWrite (); }; - -/***************************************************************************** -* -* CEvent -* -***/ - -#ifdef HS_BUILD_FOR_WIN32 -typedef HANDLE EventHandle; -//#else -//# error "CEvent: Not implemented on this platform" -//#endif - -const unsigned kEventWaitForever = (unsigned)-1; - -enum ECEventResetBehavior { - kEventManualReset, - kEventAutoReset, -}; - -class CEvent { - EventHandle m_handle; -public: - CEvent ( - ECEventResetBehavior resetType, - bool initialSet = false - ); - ~CEvent (); - - void Signal (); - void Reset (); - bool Wait (unsigned waitMs); - - const EventHandle & Handle () const { return m_handle; } -}; -#endif // HS_BUILD_FOR_WIN32 - #endif