diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2017-08-03 13:21:19 +0000 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-08-03 13:21:19 +0000 |
commit | 3b06d69d61cd677394fa7adf1ffcfa13ab8bac70 (patch) | |
tree | b071a0a3c396aa850a9024000a382165b0c00380 /src/lib/shm_flow_set.c | |
parent | b92eac2e9f6d686a9e2f748f8097aedbb373395c (diff) | |
parent | 5bb3bea07b0ff38e4646ed6f835d9bdac6beced6 (diff) | |
download | ouroboros-3b06d69d61cd677394fa7adf1ffcfa13ab8bac70.tar.gz ouroboros-3b06d69d61cd677394fa7adf1ffcfa13ab8bac70.zip |
Merged in sandervrijders/ouroboros/be-hurd (pull request #539)
build: Add check for robust mutexes
Diffstat (limited to 'src/lib/shm_flow_set.c')
-rw-r--r-- | src/lib/shm_flow_set.c | 6 |
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 |