aboutsummaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 640e0db6..0ca5e22d 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1574,15 +1574,16 @@ nni_pipe_run_cb(nni_pipe *p, nng_pipe_ev ev)
nng_pipe_cb cb;
void * arg;
+ nni_mtx_lock(&s->s_pipe_cbs_mtx);
if (!p->p_cbs) {
if (ev == NNG_PIPE_EV_ADD_PRE) {
// First event, after this we want all other events.
p->p_cbs = true;
} else {
+ nni_mtx_unlock(&s->s_pipe_cbs_mtx);
return;
}
}
- nni_mtx_lock(&s->s_pipe_cbs_mtx);
cb = s->s_pipe_cbs[ev].cb_fn;
arg = s->s_pipe_cbs[ev].cb_arg;
nni_mtx_unlock(&s->s_pipe_cbs_mtx);