summaryrefslogtreecommitdiffstats
path: root/source/OSSupport/Event.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-09-05 15:22:16 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-09-06 17:50:18 +0200
commita80be25c920a657b7be596ee9f42d2d2f8f0c5dc (patch)
treedfb4d74621fc06768d4712dba4a297e6cc0e1b78 /source/OSSupport/Event.cpp
parentFixed the Win nightbuild script naming ini files badly (thx Tigerw). (diff)
downloadcuberite-a80be25c920a657b7be596ee9f42d2d2f8f0c5dc.tar
cuberite-a80be25c920a657b7be596ee9f42d2d2f8f0c5dc.tar.gz
cuberite-a80be25c920a657b7be596ee9f42d2d2f8f0c5dc.tar.bz2
cuberite-a80be25c920a657b7be596ee9f42d2d2f8f0c5dc.tar.lz
cuberite-a80be25c920a657b7be596ee9f42d2d2f8f0c5dc.tar.xz
cuberite-a80be25c920a657b7be596ee9f42d2d2f8f0c5dc.tar.zst
cuberite-a80be25c920a657b7be596ee9f42d2d2f8f0c5dc.zip
Diffstat (limited to 'source/OSSupport/Event.cpp')
-rw-r--r--source/OSSupport/Event.cpp47
1 files changed, 0 insertions, 47 deletions
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
-}
-
-
-
-