summaryrefslogtreecommitdiff
path: root/src/irmd/registry.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-08-09 16:06:12 +0200
committerdimitri staessens <[email protected]>2016-08-09 16:06:12 +0200
commit9dce327e10bffddc9dc5058f06407e8ff12389b7 (patch)
tree97c4672e8e912efbbaf1a4e1cf3077a0cfe402b4 /src/irmd/registry.c
parent067c5661859f6a1f75adb0bb325d1641fed221a1 (diff)
downloadouroboros-9dce327e10bffddc9dc5058f06407e8ff12389b7.tar.gz
ouroboros-9dce327e10bffddc9dc5058f06407e8ff12389b7.zip
lib: Various fixes
Fix missing set of api upon flow_alloc. Various locking fixes.
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;
}