projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
report archive encoding progress
[ardour.git]
/
libs
/
pbd
/
semutils.cc
diff --git
a/libs/pbd/semutils.cc
b/libs/pbd/semutils.cc
index cf7b54d30e2babd036853a29ebc87d2e284e48f1..7f31d30fafca5d5d8c32629bb1695b089c99468e 100644
(file)
--- a/
libs/pbd/semutils.cc
+++ b/
libs/pbd/semutils.cc
@@
-21,9
+21,9
@@
using namespace PBD;
using namespace PBD;
-
ProcessSemaphore::Process
Semaphore (const char* name, int val)
+
Semaphore::
Semaphore (const char* name, int val)
{
{
-#ifdef
PLATFORM_WINDOWS
+#ifdef
WINDOWS_SEMAPHORE
if ((_sem = CreateSemaphore(NULL, val, 32767, name)) == NULL) {
throw failed_constructor ();
}
if ((_sem = CreateSemaphore(NULL, val, 32767, name)) == NULL) {
throw failed_constructor ();
}
@@
-34,7
+34,7
@@
ProcessSemaphore::ProcessSemaphore (const char* name, int val)
}
/* this semaphore does not exist for IPC */
}
/* this semaphore does not exist for IPC */
-
+
if (sem_unlink (name)) {
throw failed_constructor ();
}
if (sem_unlink (name)) {
throw failed_constructor ();
}
@@
-48,26
+48,26
@@
ProcessSemaphore::ProcessSemaphore (const char* name, int val)
#endif
}
#endif
}
-
ProcessSemaphore::~Process
Semaphore ()
+
Semaphore::~
Semaphore ()
{
{
-#ifdef
PLATFORM_WINDOWS
+#ifdef
WINDOWS_SEMAPHORE
CloseHandle(_sem);
#elif __APPLE__
sem_close (ptr_to_sem());
#endif
}
CloseHandle(_sem);
#elif __APPLE__
sem_close (ptr_to_sem());
#endif
}
-#ifdef
PLATFORM_WINDOWS
+#ifdef
WINDOWS_SEMAPHORE
int
int
-
Process
Semaphore::signal ()
+Semaphore::signal ()
{
// non-zero on success, opposite to posix
return !ReleaseSemaphore(_sem, 1, NULL);
}
int
{
// non-zero on success, opposite to posix
return !ReleaseSemaphore(_sem, 1, NULL);
}
int
-
Process
Semaphore::wait ()
+Semaphore::wait ()
{
DWORD result = 0;
result = WaitForSingleObject(_sem, INFINITE);
{
DWORD result = 0;
result = WaitForSingleObject(_sem, INFINITE);