diff options
Diffstat (limited to 'drivers/windows/semaphore_windows.cpp')
-rw-r--r-- | drivers/windows/semaphore_windows.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/windows/semaphore_windows.cpp b/drivers/windows/semaphore_windows.cpp index 28a04f4acf..bfd53f9837 100644 --- a/drivers/windows/semaphore_windows.cpp +++ b/drivers/windows/semaphore_windows.cpp @@ -28,13 +28,13 @@ /*************************************************************************/ #include "semaphore_windows.h" -#ifdef WINDOWS_ENABLED +#if defined(WINDOWS_ENABLED) && !defined(WINRT_ENABLED) #include "os/memory.h" Error SemaphoreWindows::wait() { - WaitForSingleObject(semaphore,INFINITE); + WaitForSingleObjectEx(semaphore,INFINITE, false); return OK; } Error SemaphoreWindows::post() { @@ -44,7 +44,7 @@ Error SemaphoreWindows::post() { } int SemaphoreWindows::get() const { long previous; - switch (WaitForSingleObject(semaphore, 0)) { + switch (WaitForSingleObjectEx(semaphore, 0, false)) { case WAIT_OBJECT_0: { ERR_FAIL_COND_V(!ReleaseSemaphore(semaphore, 1, &previous),-1); return previous + 1; @@ -71,12 +71,21 @@ void SemaphoreWindows::make_default() { SemaphoreWindows::SemaphoreWindows() { +#ifdef WINRT_ENABLED + semaphore=CreateSemaphoreEx( + NULL, + 0, + 0xFFFFFFF, //wathever + NULL, + 0, + SEMAPHORE_ALL_ACCESS); +#else semaphore=CreateSemaphore( - NULL, - 0, - 0xFFFFFFF, //wathever - NULL); - + NULL, + 0, + 0xFFFFFFF, //wathever + NULL); +#endif } |