From 3bf32626e42ade409a32503f23ff754aaa5e17c2 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Sun, 2 Apr 2017 12:02:55 +0200 Subject: irmd: Fix dealloc of pending flow --- src/irmd/irm_flow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/irmd/irm_flow.c') 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); } -- cgit v1.2.3