-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address netsock bugs exposed by mutex lock
Some races in the netsock and webg tests were exposed as a result of the lwIP lock acquisition causing context suspends. - In sock_read_bh_internal() and socket_write_tcp_bh_internal(), acquire the lwIP lock prior to inspecting socket state. - In netsock_poll(), net_loop_poll_queued was being cleared before acquiring the lwIP lock. If the context were to be suspended when taking the lock, further unnecessary enqueues could pile up. Move the lock acquire prior to clearing the flag. - In socket_write_tcp_bh_internal(), proactively invoke netif_poll_all() if the TCP socket sndbuf is full, avoiding the need to continue blocking in the case that netsock_poll() is scheduled but awaiting dispatch.
- Loading branch information
Showing
1 changed file
with
46 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters