diff options
Diffstat (limited to 'libs/pbd/pbd/semutils.h')
-rw-r--r-- | libs/pbd/pbd/semutils.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/pbd/pbd/semutils.h b/libs/pbd/pbd/semutils.h index 719a3d0f46..5c0191e25b 100644 --- a/libs/pbd/pbd/semutils.h +++ b/libs/pbd/pbd/semutils.h @@ -19,7 +19,11 @@ #ifndef __pbd_semutils_h__ #define __pbd_semutils_h__ +#ifdef PLATFORM_WINDOWS +#include <windows.h> +#else #include <semaphore.h> +#endif #include "pbd/libpbd_visibility.h" @@ -27,7 +31,10 @@ namespace PBD { class LIBPBD_API ProcessSemaphore { private: -#ifdef __APPLE__ +#ifdef PLATFORM_WINDOWS + HANDLE _sem; + +#elif __APPLE__ sem_t* _sem; sem_t* ptr_to_sem() const { return _sem; } #else @@ -39,8 +46,15 @@ class LIBPBD_API ProcessSemaphore { ProcessSemaphore (const char* name, int val); ~ProcessSemaphore (); +#ifdef PLATFORM_WINDOWS + + int signal (); + int wait (); + +#else int signal () { return sem_post (ptr_to_sem()); } int wait () { return sem_wait (ptr_to_sem()); } +#endif }; } |