diff options
-rw-r--r-- | Nightbuild2008.cmd | 2 | ||||
-rw-r--r-- | source/OSSupport/Event.cpp | 47 | ||||
-rw-r--r-- | source/OSSupport/Event.h | 10 |
3 files changed, 1 insertions, 58 deletions
diff --git a/Nightbuild2008.cmd b/Nightbuild2008.cmd index 0d93380e9..6de8d9f67 100644 --- a/Nightbuild2008.cmd +++ b/Nightbuild2008.cmd @@ -102,7 +102,7 @@ if errorlevel 1 goto haderror :: Copy all the example ini files into the Install folder for zipping: -copy MCServer\*.example.ini Install\*.example.ini +copy MCServer\*.example.ini Install\ :: Use 7-zip to compress the resulting files into a single file: set FILESUFFIX=%MYYEAR%_%MYMONTH%_%MYDAY%_%MYTIME%_%COMMITID% diff --git a/source/OSSupport/Event.cpp b/source/OSSupport/Event.cpp index 32f780946..cbacbba17 100644 --- a/source/OSSupport/Event.cpp +++ b/source/OSSupport/Event.cpp @@ -116,50 +116,3 @@ void cEvent::Set(void) - -cEvent::eWaitResult cEvent::Wait(int a_TimeoutMilliSec) -{ - #ifdef _WIN32 - DWORD res = WaitForSingleObject(m_Event, (DWORD)a_TimeoutMilliSec); - switch (res) - { - case WAIT_OBJECT_0: - { - // The semaphore was signalled - return wrSignalled; - } - case WAIT_TIMEOUT: - { - // The timeout was hit - return wrTimeout; - } - default: - { - LOGWARNING("cEvent: timed-waiting for the event failed: %d, GLE = %d. Continuing, but server may be unstable.", res, GetLastError()); - return wrError; - } - } - #else - timespec timeout; - timeout.tv_sec = time(NULL) + a_TimeoutMilliSec / 1000; - timeout.tv_nsec = (a_TimeoutMilliSec % 1000) * 1000000; - int res = sem_timedwait(m_Event, &timeout); - if (res == 0) - { - // The semaphore was signalled - return wrSignalled; - } - int err = errno; - if (err == ETIMEDOUT) - { - // The timeout was hit - return wrTimeout; - } - LOGWARNING("cEvent: timed-waiting for the event failed: %i, errno = %i. Continuing, but server may be unstable.", res, err); - return wrError; - #endif -} - - - - diff --git a/source/OSSupport/Event.h b/source/OSSupport/Event.h index 803d73b7e..71f418c0c 100644 --- a/source/OSSupport/Event.h +++ b/source/OSSupport/Event.h @@ -19,22 +19,12 @@ class cEvent { public: - enum eWaitResult - { - wrSignalled, - wrTimeout, - wrError, - } ; - cEvent(void); ~cEvent(); void Wait(void); void Set (void); - /// Waits for the semaphore with a timeout - eWaitResult Wait(int a_TimeoutMilliSec); - private: #ifdef _WIN32 |