mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-15 04:36:53 +08:00
LWIP_NETCONN_FULLDUPLEX: unblock rx threads on close
Threads blocked on the rx mbox are counted and on close, one "netconn closed" message per thread is posted to the mbox to ensure all threads are woken. The netconn can then be safely deleted. In socket API, "fd_used" and "fd_free_pending" help with auto-deleting the netconn. Signed-off-by: goldsimon <goldsimon@gmx.de>
This commit is contained in:
@@ -241,6 +241,11 @@ struct netconn {
|
||||
by the application thread */
|
||||
sys_mbox_t acceptmbox;
|
||||
#endif /* LWIP_TCP */
|
||||
#if LWIP_NETCONN_FULLDUPLEX
|
||||
/** number of threads waiting on an mbox. This is required to unblock
|
||||
all threads when closing while threads are waiting. */
|
||||
int mbox_threads_waiting;
|
||||
#endif
|
||||
/** only used for socket layer */
|
||||
#if LWIP_SOCKET
|
||||
int socket;
|
||||
|
||||
@@ -187,6 +187,9 @@ struct dns_api_msg {
|
||||
};
|
||||
#endif /* LWIP_DNS */
|
||||
|
||||
#if LWIP_NETCONN_FULLDUPLEX
|
||||
int lwip_netconn_is_deallocated_msg(void *msg);
|
||||
#endif
|
||||
int lwip_netconn_is_err_msg(void *msg, err_t *err);
|
||||
void lwip_netconn_do_newconn (void *m);
|
||||
void lwip_netconn_do_delconn (void *m);
|
||||
|
||||
Reference in New Issue
Block a user