aboutsummaryrefslogtreecommitdiffstats
path: root/src/zix/sem.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-14 15:44:28 +0100
committerDavid Robillard <d@drobilla.net>2020-12-14 15:44:28 +0100
commit9226bfc74fa6580bbcec428e6291fb81cefe4e42 (patch)
tree7783a54207e94e95448a5a5278fb29c460aa3190 /src/zix/sem.h
parent3b6afde09317b4d79ffb8a65cb49d525fc7b4101 (diff)
downloadjalv-9226bfc74fa6580bbcec428e6291fb81cefe4e42.tar.gz
jalv-9226bfc74fa6580bbcec428e6291fb81cefe4e42.tar.bz2
jalv-9226bfc74fa6580bbcec428e6291fb81cefe4e42.zip
Update zix
Diffstat (limited to 'src/zix/sem.h')
-rw-r--r--src/zix/sem.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/zix/sem.h b/src/zix/sem.h
index e306052..faeb148 100644
--- a/src/zix/sem.h
+++ b/src/zix/sem.h
@@ -25,14 +25,16 @@
# include <limits.h>
# include <windows.h>
#else
-# include <semaphore.h>
# include <errno.h>
+# include <semaphore.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
+#include <stdbool.h>
+
/**
@addtogroup zix
@{
@@ -40,6 +42,8 @@ extern "C" {
@{
*/
+struct ZixSemImpl;
+
/**
A counting semaphore.
@@ -148,7 +152,7 @@ static inline ZixStatus
zix_sem_init(ZixSem* sem, unsigned initial)
{
sem->sem = CreateSemaphore(NULL, initial, LONG_MAX, NULL);
- return (sem->sem) ? ZIX_STATUS_ERROR : ZIX_STATUS_SUCCESS;
+ return (sem->sem) ? ZIX_STATUS_SUCCESS : ZIX_STATUS_ERROR;
}
static inline void