aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/survey0
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/survey0')
-rw-r--r--src/protocol/survey0/respond.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/protocol/survey0/respond.c b/src/protocol/survey0/respond.c
index db18a4e8..fbdeb65a 100644
--- a/src/protocol/survey0/respond.c
+++ b/src/protocol/survey0/respond.c
@@ -402,15 +402,14 @@ resp0_pipe_send_cb(void *arg)
nni_msg * msg;
size_t len;
- nni_mtx_lock(&s->mtx);
- p->busy = false;
if (nni_aio_result(p->aio_send) != 0) {
nni_msg_free(nni_aio_get_msg(p->aio_send));
nni_aio_set_msg(p->aio_send, NULL);
nni_pipe_stop(p->npipe);
- nni_mtx_unlock(&s->mtx);
return;
}
+ nni_mtx_lock(&s->mtx);
+ p->busy = false;
if ((ctx = nni_list_first(&p->sendq)) == NULL) {
// Nothing else to send.
if (p->id == s->ctx->pipe_id) {