summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/semutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/pbd/semutils.h')
-rw-r--r--libs/pbd/pbd/semutils.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/pbd/pbd/semutils.h b/libs/pbd/pbd/semutils.h
index 6f5f0e9331..af5c201b85 100644
--- a/libs/pbd/pbd/semutils.h
+++ b/libs/pbd/pbd/semutils.h
@@ -19,13 +19,20 @@
#ifndef __pbd_semutils_h__
#define __pbd_semutils_h__
+#ifdef PLATFORM_WINDOWS
+#include <windows.h>
+#else
#include <semaphore.h>
+#endif
namespace PBD {
class ProcessSemaphore {
private:
-#ifdef __APPLE__
+#ifdef PLATFORM_WINDOWS
+ HANDLE _sem;
+
+#elif __APPLE__
sem_t* _sem;
sem_t* ptr_to_sem() const { return _sem; }
#else
@@ -37,8 +44,15 @@ class 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
};
}