summaryrefslogtreecommitdiff
path: root/src/lib/shm_flow_set.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2017-08-04 04:40:30 -0600
committerDimitri Staessens <[email protected]>2017-08-04 04:40:30 -0600
commit6464bb4b9759b10aa144af2edf98a898a60256c7 (patch)
treecf80113aee8408b68f845ed7467cce3a8e5bb657 /src/lib/shm_flow_set.c
parent6eb3105f908158130bbc415e7376e3c2d7aafb5e (diff)
parentf85c70fdb6dbbadb903155120892e55b0eff5dda (diff)
downloadouroboros-6464bb4b9759b10aa144af2edf98a898a60256c7.tar.gz
ouroboros-6464bb4b9759b10aa144af2edf98a898a60256c7.zip
Merge branch 'be' of bitbucket.com:dstaesse/ouroboros into be
Diffstat (limited to 'src/lib/shm_flow_set.c')
-rw-r--r--src/lib/shm_flow_set.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/shm_flow_set.c b/src/lib/shm_flow_set.c
index 67abbb5b..7660b1dd 100644
--- a/src/lib/shm_flow_set.c
+++ b/src/lib/shm_flow_set.c
@@ -117,7 +117,7 @@ struct shm_flow_set * shm_flow_set_create()
(set->fqueues + AP_MAX_FQUEUES * (SHM_BUFFER_SIZE));
pthread_mutexattr_init(&mattr);
-#ifndef __APPLE__
+#ifdef HAVE_ROBUST_MUTEX
pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST);
#endif
pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED);
@@ -336,7 +336,7 @@ ssize_t shm_flow_set_wait(const struct shm_flow_set * set,
assert(idx < AP_MAX_FQUEUES);
assert(fqueue);
-#ifdef __APPLE__
+#ifndef HAVE_ROBUST_MUTEX
pthread_mutex_lock(set->lock);
#else
if (pthread_mutex_lock(set->lock) == EOWNERDEAD)
@@ -358,7 +358,7 @@ ssize_t shm_flow_set_wait(const struct shm_flow_set * set,
else
ret = -pthread_cond_wait(set->conds + idx,
set->lock);
-#ifndef __APPLE__
+#ifdef HAVE_ROBUST_MUTEX
if (ret == -EOWNERDEAD)
pthread_mutex_consistent(set->lock);
#endif