From 9dce327e10bffddc9dc5058f06407e8ff12389b7 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 9 Aug 2016 16:06:12 +0200 Subject: lib: Various fixes Fix missing set of api upon flow_alloc. Various locking fixes. --- src/irmd/registry.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/irmd/registry.c') diff --git a/src/irmd/registry.c b/src/irmd/registry.c index ec1c3987..ae8c3b0a 100644 --- a/src/irmd/registry.c +++ b/src/irmd/registry.c @@ -503,6 +503,8 @@ struct reg_api * registry_add_api_name(struct list_head * registry, return NULL; } + pthread_mutex_lock(&e->state_lock); + if (e->state == REG_NAME_IDLE || e->state == REG_NAME_AUTO_ACCEPT || e->state == REG_NAME_AUTO_EXEC) { e->state = REG_NAME_FLOW_ACCEPT; @@ -511,6 +513,8 @@ struct reg_api * registry_add_api_name(struct list_head * registry, list_add(&i->next, &e->reg_apis); + pthread_mutex_unlock(&e->state_lock); + return i; } -- cgit v1.2.3