summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-04-02 10:14:58 +0000
committerSander Vrijders <[email protected]>2017-04-02 10:14:58 +0000
commitbfb4d3794c5916f297aa8173d1ce52acc23dfb77 (patch)
treee76e6fda1f5734ef51931be8ccb1d9e92450901e
parent484e74fd35417de61005662afe016661ee78114c (diff)
parent3bf32626e42ade409a32503f23ff754aaa5e17c2 (diff)
downloadouroboros-bfb4d3794c5916f297aa8173d1ce52acc23dfb77.tar.gz
ouroboros-bfb4d3794c5916f297aa8173d1ce52acc23dfb77.zip
Merged in dstaesse/ouroboros/be-irmd (pull request #454)
irmd: Fix dealloc of pending flow
-rw-r--r--src/irmd/irm_flow.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/irmd/irm_flow.c b/src/irmd/irm_flow.c
index 6a99b081..7a02b01a 100644
--- a/src/irmd/irm_flow.c
+++ b/src/irmd/irm_flow.c
@@ -148,15 +148,18 @@ enum flow_state irm_flow_wait_state(struct irm_flow * f,
assert(f);
assert(state != FLOW_NULL);
assert(state != FLOW_DESTROY);
+ assert(state != FLOW_DEALLOC_PENDING);
pthread_mutex_lock(&f->state_lock);
assert(f->state != FLOW_NULL);
- while (!(f->state == state || f->state == FLOW_DESTROY))
+ while (!(f->state == state ||
+ f->state == FLOW_DESTROY ||
+ f->state == FLOW_DEALLOC_PENDING))
pthread_cond_wait(&f->state_cond, &f->state_lock);
- if (f->state == FLOW_DESTROY) {
+ if (f->state == FLOW_DESTROY || f->state == FLOW_DEALLOC_PENDING) {
f->state = FLOW_NULL;
pthread_cond_broadcast(&f->state_cond);
}