aboutsummaryrefslogtreecommitdiffstats
path: root/internal-linux.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-06-11 20:14:09 +0200
committerMattias Andrée <maandree@kth.se>2020-06-11 20:14:09 +0200
commitb56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b (patch)
treeaa502d70d9969c333ccf9e70d55fd6dea41623c2 /internal-linux.h
parentFix error checking (diff)
downloadlibaxl-b56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b.tar.gz
libaxl-b56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b.tar.bz2
libaxl-b56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b.tar.xz
Misc, mainly connect stuff
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'internal-linux.h')
-rw-r--r--internal-linux.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal-linux.h b/internal-linux.h
index 553a783..6a4103f 100644
--- a/internal-linux.h
+++ b/internal-linux.h
@@ -11,7 +11,7 @@ _Static_assert(sizeof(MUTEX) == sizeof(uint32_t));
#define INIT_MUTEX(MUTEX)\
- ((void)0) /* TODO atomic_init(&(MUTEX), 0) */
+ atomic_init(&(MUTEX), 0)
#define _TRYLOCK(MUTEX)\
!atomic_exchange(&(MUTEX), 1)
@@ -27,6 +27,7 @@ _Static_assert(sizeof(MUTEX) == sizeof(uint32_t));
atomic_store(&(MUTEX), 0);\
if (syscall(SYS_futex, &(MUTEX), FUTEX_PRIVATE_FLAG | FUTEX_WAKE, INT_MAX, NULL, 0, 0) < 0) {\
/* TODO handle of error in _UNLOCK */\
+ abort();\
}\
} while (0)
@@ -34,5 +35,6 @@ _Static_assert(sizeof(MUTEX) == sizeof(uint32_t));
do {\
if (syscall(SYS_futex, &(MUTEX), FUTEX_PRIVATE_FLAG | FUTEX_WAIT, 1, NULL, 0, 0) < 0) {\
/* TODO handle of error in _WAIT */\
+ abort();\
}\
} while (0)