]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: wake up all waiting threads at socket shutdown
authorYing Xue <ying.xue@windriver.com>
Mon, 29 Oct 2012 13:38:15 +0000 (09:38 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 22 Nov 2012 01:06:29 +0000 (20:06 -0500)
commit73d06be0c669b596387d341112462c1eb7cd108f
tree162b06a086e3adffc182da349179b9a69de89f21
parentd7d7823eed2b606d00d7af6f45c83ed773f3d7cf
tipc: wake up all waiting threads at socket shutdown

When a socket is shut down, we should wake up all thread sleeping on
it, instead of just one of them. Otherwise, when several threads are
polling the same socket, and one of them does shutdown(), the
remaining threads may end up sleeping forever.

Also, to align socket usage with common practice in other stacks, we
use one of the common socket callback handlers, sk_state_change(),
to wake up pending users. This is similar to the usage in e.g.
inet_shutdown(). [net/ipv4/af_inet.c].

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/tipc/socket.c