summaryrefslogtreecommitdiff
path: root/src/irmd/registry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/irmd/registry.c')
-rw-r--r--src/irmd/registry.c4
1 files changed, 4 insertions, 0 deletions
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;
}