Added an overridable define to get informed when the tcpip_thread processes messages or timeouts to implement a watchdog.

This commit is contained in:
goldsimon 2010-04-14 07:02:26 +00:00
parent 3347762df3
commit 2e18a9be63
4 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,10 @@ HISTORY
++ New features:
2010-04-14: Simon Goldschmidt
* tcpip.h/.c, timers.c: Added an overridable define to get informed when the
tcpip_thread processes messages or timeouts to implement a watchdog.
2010-03-28: Simon Goldschmidt
* ip_frag.c: create a new (contiguous) PBUF_RAM for every outgoing
fragment if LWIP_NETIF_TX_SINGLE_PBUF==1

View File

@ -83,6 +83,7 @@ tcpip_thread(void *arg)
LOCK_TCPIP_CORE();
while (1) { /* MAIN Loop */
UNLOCK_TCPIP_CORE();
LWIP_TCPIP_THREAD_ALIVE();
/* wait for a message, timeouts are processed while waiting */
sys_timeouts_mbox_fetch(&mbox, (void **)&msg);
LOCK_TCPIP_CORE();

View File

@ -467,6 +467,7 @@ sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg)
h(arg);
UNLOCK_TCPIP_CORE();
}
LWIP_TCPIP_THREAD_ALIVE();
/* We try again to fetch a message from the mbox. */
goto again;

View File

@ -48,6 +48,12 @@
extern "C" {
#endif
/** Define this to something that triggers a watchdog. This is called from
* tcpip_thread after processing a message. */
#ifndef LWIP_TCPIP_THREAD_ALIVE
#define LWIP_TCPIP_THREAD_ALIVE()
#endif
#if LWIP_TCPIP_CORE_LOCKING
/** The global semaphore to lock the stack. */
extern sys_mutex_t lock_tcpip_core;