summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irmd/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 17e51c05..1da4b310 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -771,8 +771,6 @@ static struct port_map_entry * flow_accept(pid_t api,
return NULL;
}
- rne->req_ae_name = NULL;
-
if (dst_ae_name != NULL)
*dst_ae_name = rne->req_ae_name;
@@ -1179,14 +1177,17 @@ static struct port_map_entry * flow_req_arr(pid_t api,
pthread_mutex_unlock(&rne->state_lock);
+ pthread_rwlock_unlock(&instance->state_lock);
+
while (acc_wait) {
+ pthread_rwlock_rdlock(&instance->state_lock);
pthread_mutex_lock(&rne->state_lock);
- acc_wait = (rne->state == REG_NAME_FLOW_ARRIVED);
+ acc_wait = (rne->state == REG_NAME_FLOW_ARRIVED &&
+ instance->state == IRMD_RUNNING);
pthread_mutex_unlock(&rne->state_lock);
+ pthread_rwlock_unlock(&instance->state_lock);
}
- pthread_rwlock_unlock(&instance->state_lock);
-
return pme;
}