summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/gam.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-02-09 08:03:44 +0000
committerSander Vrijders <[email protected]>2017-02-09 08:03:44 +0000
commit275dc65b22e39654e4dfc9cbd13277e490c8dccd (patch)
tree1ccf39e67ff900147bf05ac40d0bd2542a29b970 /src/ipcpd/normal/gam.c
parent7403be0eadcc772cd3a44615f34bff0ce7009f86 (diff)
parent62557fd2a0cf5c749a8262949200019f4bbe8763 (diff)
downloadouroboros-275dc65b22e39654e4dfc9cbd13277e490c8dccd.tar.gz
ouroboros-275dc65b22e39654e4dfc9cbd13277e490c8dccd.zip
Merged in dstaesse/ouroboros/be-fixes (pull request #366)
Be fixes
Diffstat (limited to 'src/ipcpd/normal/gam.c')
-rw-r--r--src/ipcpd/normal/gam.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ipcpd/normal/gam.c b/src/ipcpd/normal/gam.c
index fae34dfe..36025f85 100644
--- a/src/ipcpd/normal/gam.c
+++ b/src/ipcpd/normal/gam.c
@@ -283,6 +283,9 @@ int gam_flow_wait(struct gam * instance,
pthread_mutex_lock(&instance->gas_lock);
+ pthread_cleanup_push((void(*)(void *))pthread_mutex_unlock,
+ (void *) &instance->gas_lock);
+
while (list_is_empty(&instance->gas))
pthread_cond_wait(&instance->gas_cond, &instance->gas_lock);
@@ -299,7 +302,7 @@ int gam_flow_wait(struct gam * instance,
list_del(&ga->next);
free(ga);
- pthread_mutex_unlock(&instance->gas_lock);
+ pthread_cleanup_pop(true);
return 0;
}