accept: Call pru_accept in protocol thread
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 2 Dec 2011 11:54:17 +0000 (19:54 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 2 Dec 2011 11:57:54 +0000 (19:57 +0800)
commitf328adf5da5056ca408a3e20b2fb449d9f5a72eb
treef07728322204636ce2171c23c599ed21df75548b
parent1dd3879b7a22e55a6a8cf4679998e1a508b2d5a7
accept: Call pru_accept in protocol thread

This avoids socket.so_pcb use-after-check race against protocol thread.

There is no performance impact on the mostly used sockets:
- IPv4/IPv6 TCP implemented pru_savefaddr, so their pru_accept will not
  be called at all
- UNIX domain socket uses sync msgport, so no protocol thread dispatching
sys/kern/uipc_msg.c
sys/kern/uipc_socket.c
sys/sys/protosw.h
sys/sys/socketops.h