Skip to content
Commit 76b74f00 authored by Robert Lubos's avatar Robert Lubos Committed by Anas Nashif
Browse files

net: sockets: Fix accept() not being interrupted on close()



The accept() so far would block with mutex held, making it impossible to
interrupt it from another thread when the socket was closed.

Fix this, by reusing the condvar mechanism used for receiving. It's OK
to use the same routine, as underneath accept() is monitoring the same
FIFO as recv().

Additionally, simplify k_fifo_get() handling in accept() - as the
waiting now takes place on condvar, it can be used in a non-blocking
manner. Blocking accept() call should not reach this place if there's no
new incoming connection waiting on the FIFO.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent af8c980e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment