summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/connmgr.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-03-22 16:06:52 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-03-22 16:06:52 +0000
commit4d31a76040e3bc9218cd731f745c9ea4e38a2a5a (patch)
tree9fd26561be8e27f15d69129f6f7257a136888eb5 /src/ipcpd/normal/connmgr.c
parent79090eb2fc0fe4f6582aca556c05435dace60046 (diff)
parent3964be811b57fca965b979b7c21f24532a172bd4 (diff)
downloadouroboros-4d31a76040e3bc9218cd731f745c9ea4e38a2a5a.tar.gz
ouroboros-4d31a76040e3bc9218cd731f745c9ea4e38a2a5a.zip
Merged in dstaesse/ouroboros/be-fixes (pull request #413)
Be fixes
Diffstat (limited to 'src/ipcpd/normal/connmgr.c')
-rw-r--r--src/ipcpd/normal/connmgr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c
index b97d2b23..b8314917 100644
--- a/src/ipcpd/normal/connmgr.c
+++ b/src/ipcpd/normal/connmgr.c
@@ -328,7 +328,7 @@ int connmgr_alloc(struct ae * ae,
int connmgr_wait(struct ae * ae,
struct conn * conn)
{
- struct ae_conn * ae_conn;
+ struct ae_conn * ae_conn = NULL;
assert(ae);
assert(conn);
@@ -341,6 +341,8 @@ int connmgr_wait(struct ae * ae,
while (list_is_empty(&ae->conn_list))
pthread_cond_wait(&ae->conn_cond, &ae->conn_lock);
+ pthread_cleanup_pop(false);
+
ae_conn = list_first_entry((&ae->conn_list), struct ae_conn, next);
if (ae_conn == NULL) {
pthread_mutex_unlock(&ae->conn_lock);
@@ -352,7 +354,7 @@ int connmgr_wait(struct ae * ae,
list_del(&ae_conn->next);
free(ae_conn);
- pthread_cleanup_pop(true);
+ pthread_mutex_unlock(&ae->conn_lock);
return 0;
}