From 3fd43c488b47874db22a87a1d87eed94bbd85725 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 1 Jan 2017 14:34:29 -0800 Subject: Pipe simplifications for thread management. This may also address a race in closing down pipes. Now pipes are always registered with the socket. They also always have both a sender and receiver thread. If the protocol doesn't need one or the other, the stock thread just exits early. --- src/core/socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index 1700ca9f..2e95c229 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -53,7 +53,9 @@ nni_reaper(void *arg) nni_mutex_exit(&sock->s_mx); // This should already have been done. - pipe->p_ops.p_close(pipe->p_trandata); + if (pipe->p_trandata != NULL) { + pipe->p_ops.p_close(pipe->p_trandata); + } // Remove the pipe from the protocol. Protocols may // keep lists of pipes for managing their topologies. -- cgit v1.2.3-70-g09d2