tipc: improve function tipc_wait_for_rcvmsg()
authorTung Nguyen <tung.q.nguyen@dektech.com.au>
Tue, 19 Feb 2019 04:20:48 +0000 (11:20 +0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Feb 2019 21:58:05 +0000 (13:58 -0800)
commit48766a583c7961af080de2df692f476624a9a21a
tree2ebebb66de46f9d47e2a65ce00b93da76c7a69d9
parent223b7329ec6a0dae1b7f7db7b770e93f4a069ef9
tipc: improve function tipc_wait_for_rcvmsg()

This commit replaces schedule_timeout() with wait_woken()
in function tipc_wait_for_rcvmsg(). wait_woken() uses
memory barriers in its implementation to avoid potential
race condition when putting a process into sleeping state
and then waking it up.

Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c