diff options
author | Mattias Andrée <maandree@kth.se> | 2020-06-11 20:14:09 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-06-11 20:14:09 +0200 |
commit | b56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b (patch) | |
tree | aa502d70d9969c333ccf9e70d55fd6dea41623c2 /internal-linux.h | |
parent | Fix error checking (diff) | |
download | libaxl-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 '')
-rw-r--r-- | internal-linux.h | 4 |
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) |