diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-03-10 17:12:01 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-03-10 17:12:01 +0000 |
commit | a0a9f969a6831739e9a9dc325b5d2e4048635bd7 (patch) | |
tree | 08a87fb4453a30f8761a5669b78cc351e1af5af6 /lib/win32 | |
parent | 07be2b3a2181d97c393d79f731e3d564733d58bd (diff) |
Our timer code only supports ITIMER_REAL (refs #3)
Diffstat (limited to 'lib/win32')
-rw-r--r-- | lib/win32/emu.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp index 16c4a2ef..7ee2b5a1 100644 --- a/lib/win32/emu.cpp +++ b/lib/win32/emu.cpp @@ -44,7 +44,14 @@ int setitimer(int type, struct itimerval *timeout, void *arg) { ASSERT(gTimerInitialised); + if (ITIMER_REAL != type) + { + errno = ENOSYS; + return -1; + } + EnterCriticalSection(&gLock); + // we only need seconds for the mo! if (timeout->it_value.tv_sec == 0 && timeout->it_value.tv_usec == 0) @@ -58,6 +65,7 @@ int setitimer(int type, struct itimerval *timeout, void *arg) ourTimer.interval = timeout->it_interval.tv_sec; gTimerList.push_back(ourTimer); } + LeaveCriticalSection(&gLock); // indicate success |