diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-01 19:48:10 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-01 19:48:10 -0800 |
| commit | 783470724ed22b315f2ecc4e3b1ac9d199d44ea2 (patch) | |
| tree | d4883f305b1f2c6f57710cd8900f4b0932ae14c0 /src/core/pipe.c | |
| parent | bbed172a2b38f9227ca9e1c02a933df068e5eaf7 (diff) | |
| download | nng-783470724ed22b315f2ecc4e3b1ac9d199d44ea2.tar.gz nng-783470724ed22b315f2ecc4e3b1ac9d199d44ea2.tar.bz2 nng-783470724ed22b315f2ecc4e3b1ac9d199d44ea2.zip | |
Final purge of old threading & synch stuff.
Diffstat (limited to 'src/core/pipe.c')
| -rw-r--r-- | src/core/pipe.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/pipe.c b/src/core/pipe.c index 8fa41934..34db782a 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -48,15 +48,15 @@ nni_pipe_close(nni_pipe *p) p->p_ops.p_close(p->p_trandata); } - nni_mutex_enter(&sock->s_mx); + nni_mtx_lock(&sock->s_mx); if (!p->p_reap) { // schedule deferred reap/close p->p_reap = 1; nni_list_remove(&sock->s_pipes, p); nni_list_append(&sock->s_reaps, p); - nni_cond_broadcast(&sock->s_cv); + nni_cv_wake(&sock->s_cv); } - nni_mutex_exit(&sock->s_mx); + nni_mtx_unlock(&sock->s_mx); } @@ -119,9 +119,9 @@ nni_pipe_create(nni_pipe **pp, nni_endpt *ep) return (rv); } p->p_psize = sock->s_ops.proto_pipe_size; - nni_mutex_enter(&sock->s_mx); + nni_mtx_lock(&sock->s_mx); nni_list_append(&sock->s_pipes, p); - nni_mutex_exit(&sock->s_mx); + nni_mtx_unlock(&sock->s_mx); *pp = p; return (0); @@ -146,9 +146,9 @@ nni_pipe_start(nni_pipe *pipe) int collide; nni_socket *sock = pipe->p_sock; - nni_mutex_enter(&sock->s_mx); + nni_mtx_lock(&sock->s_mx); if (sock->s_closing) { - nni_mutex_exit(&sock->s_mx); + nni_mtx_unlock(&sock->s_mx); return (NNG_ECLOSED); } @@ -178,12 +178,12 @@ nni_pipe_start(nni_pipe *pipe) // XXX: Publish event - nni_mutex_exit(&sock->s_mx); + nni_mtx_unlock(&sock->s_mx); return (0); fail: pipe->p_reap = 1; - nni_mutex_exit(&sock->s_mx); + nni_mtx_unlock(&sock->s_mx); nni_pipe_close(pipe); return (rv); } |
