Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2014 18:00:07 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 1200964 for review
Message-ID:  <201409301800.s8UI07XN063918@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@1200964?ac=10

Change 1200964 by jhb@jhb_jhbbsd on 2014/09/30 17:59:30

	Stash this patch here.

Affected files ...

.. //depot/projects/smpng/sys/kern/uipc_socket.c#161 edit

Differences ...

==== //depot/projects/smpng/sys/kern/uipc_socket.c#161 (text+ko) ====

@@ -3003,7 +3003,12 @@
 {
 	int revents = 0;
 
-	SOCKBUF_LOCK(&so->so_snd);
+	if (events & (POLLOUT | POLLWRNORM))
+		SOCKBUF_LOCK(&so->so_snd);
+	/*
+	 * The so_rcv lock doubles as SOCK_LOCK so it it is needed for
+	 * all requests.
+	 */
 	SOCKBUF_LOCK(&so->so_rcv);
 	if (events & (POLLIN | POLLRDNORM))
 		if (soreadabledata(so))
@@ -3038,7 +3043,8 @@
 	}
 
 	SOCKBUF_UNLOCK(&so->so_rcv);
-	SOCKBUF_UNLOCK(&so->so_snd);
+	if (events & (POLLOUT | POLLWRNORM))
+		SOCKBUF_UNLOCK(&so->so_snd);
 	return (revents);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409301800.s8UI07XN063918>