SNMP: Support LWIP_TCPIP_CORE_LOCKING sync method

This commit is contained in:
Dirk Ziegelmeier 2016-03-08 22:08:34 +01:00
parent 5d637360cc
commit 9fbf5a4004

View File

@ -91,10 +91,17 @@ netif_to_num(const struct netif *netif)
#if SNMP_USE_NETCONN
#include "lwip/tcpip.h"
#include "lwip/priv/tcpip_priv.h"
void
snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg)
{
#if LWIP_TCPIP_CORE_LOCKING
LOCK_TCPIP_CORE();
fn(arg);
UNLOCK_TCPIP_CORE();
#else
tcpip_callback_with_block(fn, arg, 1);
#endif
}
struct snmp_threadsync_instance snmp_mib2_lwip_locks;