summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket2.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1997-03-31 12:30:01 +0000
committerdg <dg@FreeBSD.org>1997-03-31 12:30:01 +0000
commitb95c5ce5786c8b14b3a68ddfb63837b22a905aa7 (patch)
treef924aad136dc4e0ea04eb11fe492055cab1e297d /sys/kern/uipc_socket2.c
parentdb96cd70748c6a478dc6c7b64b65afa26d720741 (diff)
downloadFreeBSD-src-b95c5ce5786c8b14b3a68ddfb63837b22a905aa7.zip
FreeBSD-src-b95c5ce5786c8b14b3a68ddfb63837b22a905aa7.tar.gz
In accept1(), falloc() is called after the process has awoken, but prior
to removing the connection from the queue. The problem here is that falloc() may block and this would allow another process to accept the connection instead. If this happens to leave the queue empty, then the system will panic with an "accept: nothing queued". Also changed a wakeup() to a wakeup_one() to avoid the "thundering herd" problem on new connections in Apache (or any other application that has multiple processes blocked in accept() for the same socket).
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r--sys/kern/uipc_socket2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index e19db0c..4bddd1a 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id: uipc_socket2.c,v 1.21 1997/02/19 19:15:43 wollman Exp $
+ * $Id: uipc_socket2.c,v 1.22 1997/02/24 20:30:57 wollman Exp $
*/
#include <sys/param.h>
@@ -111,9 +111,9 @@ soisconnected(so)
TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
so->so_state |= SS_COMP;
sorwakeup(head);
- wakeup((caddr_t)&head->so_timeo);
+ wakeup_one(&head->so_timeo);
} else {
- wakeup((caddr_t)&so->so_timeo);
+ wakeup(&so->so_timeo);
sorwakeup(so);
sowwakeup(so);
}
OpenPOWER on IntegriCloud