summaryrefslogtreecommitdiff
path: root/src/lib/shm_du_map.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-09 16:06:12 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-09 16:06:12 +0200
commit9dce327e10bffddc9dc5058f06407e8ff12389b7 (patch)
tree97c4672e8e912efbbaf1a4e1cf3077a0cfe402b4 /src/lib/shm_du_map.c
parent067c5661859f6a1f75adb0bb325d1641fed221a1 (diff)
downloadouroboros-9dce327e10bffddc9dc5058f06407e8ff12389b7.tar.gz
ouroboros-9dce327e10bffddc9dc5058f06407e8ff12389b7.zip
lib: Various fixes
Fix missing set of api upon flow_alloc. Various locking fixes.
Diffstat (limited to 'src/lib/shm_du_map.c')
-rw-r--r--src/lib/shm_du_map.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/shm_du_map.c b/src/lib/shm_du_map.c
index 3e2c99d4..9ca282b9 100644
--- a/src/lib/shm_du_map.c
+++ b/src/lib/shm_du_map.c
@@ -91,14 +91,11 @@ static void garbage_collect(struct shm_du_map * dum)
{
#ifdef SHM_DU_MAP_MULTI_BLOCK
struct shm_du_buff * sdb;
- while (!shm_map_empty(dum) &&
- (sdb = get_tail_ptr(dum))->dst_api == -1)
-
+ while (!shm_map_empty(dum) && (sdb = get_tail_ptr(dum))->dst_api == -1)
*dum->ptr_tail = (*dum->ptr_tail + sdb->blocks)
& (SHM_BUFFER_SIZE - 1);
#else
- while (!shm_map_empty(dum) &&
- get_tail_ptr(dum)->dst_api == -1)
+ while (!shm_map_empty(dum) && get_tail_ptr(dum)->dst_api == -1)
*dum->ptr_tail =
(*dum->ptr_tail + 1) & (SHM_BUFFER_SIZE - 1);
@@ -296,8 +293,7 @@ void * shm_du_map_sanitize(void * o)
struct timespec now;
struct timespec dl;
- if (pthread_cond_wait(dum->full, dum->lock)
- == EOWNERDEAD) {
+ if (pthread_cond_wait(dum->full, dum->lock) == EOWNERDEAD) {
LOG_WARN("Recovering dead mutex.");
pthread_mutex_consistent(dum->lock);
}