Add LWIP_TCPIP_CORE_LOCKING option (0 as default value) to experiment "locking" as feature to communicate with tcpip_thread for sequential API (netconn & socket layers). Add a alternative code for lwip_sendto to how the code can be optimized with such feature....

This commit is contained in:
fbernon
2007-06-08 19:27:59 +00:00
parent 0b9c9f9ede
commit 090aaefb39
8 changed files with 95 additions and 25 deletions

View File

@@ -34,6 +34,7 @@
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/memp.h"
#include "lwip/tcpip.h"
#if (NO_SYS == 0)
@@ -67,10 +68,14 @@ sys_mbox_fetch(sys_mbox_t mbox, void **msg)
timeouts = sys_arch_timeouts();
if (!timeouts || !timeouts->next) {
UNLOCK_TCPIP_CORE();
time = sys_arch_mbox_fetch(mbox, msg, 0);
LOCK_TCPIP_CORE();
} else {
if (timeouts->next->time > 0) {
UNLOCK_TCPIP_CORE();
time = sys_arch_mbox_fetch(mbox, msg, timeouts->next->time);
LOCK_TCPIP_CORE();
} else {
time = SYS_ARCH_TIMEOUT;
}