mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-23 16:47:05 +08:00
* sys.h, api_lib.c: Provide new sys_mbox_tryfetch function.
Require ports to provide new sys_arch_mbox_tryfetch function to get
a message if one is there, otherwise return with SYS_MBOX_EMPTY.
This commit is contained in:
@@ -284,7 +284,7 @@ netconn_delete(struct netconn *conn)
|
||||
|
||||
/* Drain the recvmbox. */
|
||||
if (conn->recvmbox != SYS_MBOX_NULL) {
|
||||
while (sys_arch_mbox_fetch(conn->recvmbox, &mem, 1) != SYS_ARCH_TIMEOUT) {
|
||||
while (sys_mbox_tryfetch(conn->recvmbox, &mem) != SYS_MBOX_EMPTY) {
|
||||
if (conn->type == NETCONN_TCP) {
|
||||
if(mem != NULL)
|
||||
pbuf_free((struct pbuf *)mem);
|
||||
@@ -299,7 +299,7 @@ netconn_delete(struct netconn *conn)
|
||||
|
||||
/* Drain the acceptmbox. */
|
||||
if (conn->acceptmbox != SYS_MBOX_NULL) {
|
||||
while (sys_arch_mbox_fetch(conn->acceptmbox, &mem, 1) != SYS_ARCH_TIMEOUT) {
|
||||
while (sys_mbox_tryfetch(conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
|
||||
netconn_delete((struct netconn *)mem);
|
||||
}
|
||||
sys_mbox_free(conn->acceptmbox);
|
||||
|
||||
Reference in New Issue
Block a user