From 58c21eb13c49dc7933d9edb5a33ba78cfd16d5ab Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 11 Apr 2017 20:59:00 +0200 Subject: [PATCH] sockets: speed up event_callback: don't iterate select_cb_list for NETCONN_EVT_RCVMINUS/SENDMINUS --- src/api/sockets.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/sockets.c b/src/api/sockets.c index 031fcc32..1181794a 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -2053,12 +2053,14 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len) break; case NETCONN_EVT_RCVMINUS: sock->rcvevent--; + goto no_select_wakeup; break; case NETCONN_EVT_SENDPLUS: sock->sendevent = 1; break; case NETCONN_EVT_SENDMINUS: sock->sendevent = 0; + goto no_select_wakeup; break; case NETCONN_EVT_ERROR: sock->errevent = 1; @@ -2069,6 +2071,7 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len) } if (sock->select_waiting == 0) { +no_select_wakeup: /* noone is waiting for this socket, no need to check select_cb_list */ SYS_ARCH_UNPROTECT(lev); done_socket(sock);