components/esp_netif/lwip/esp_netif_lwip.c
/**
 * @brief Initiates a tcpip remote call if called from another task
 * or calls the function directly if executed from lwip task
 */
@brief Initiates a tcpip remote call if called from another task
or calls the function directly if executed from lwip task
@brief Initiates a tcpip remote call if called from another task or calls the function directly if executed from lwip task
static inline esp_err_t esp_netif_lwip_ipc_call(esp_netif_api_fn fn, esp_netif_t *netif, void *data)
{
    esp_netif_api_msg_t msg = {
            .esp_netif = netif,
            .data = data,
            .api_fn = fn
    };
#if !LWIP_TCPIP_CORE_LOCKING
    if (g_lwip_task != xTaskGetCurrentTaskHandle()) {
        ESP_LOGD(TAG, "check: remote, if=%p fn=%p\n", netif, fn);
        sys_arch_sem_wait(&api_lock_sem, 0);
        tcpip_send_msg_wait_sem((tcpip_callback_fn)esp_netif_api_cb, &msg, &api_sync_sem);
        sys_sem_signal(&api_lock_sem);
        return msg.ret;
    }
#endif 
    ESP_LOGD(TAG, "check: local, if=%p fn=%p\n", netif, fn);
    return fn(&msg);
}
static inline esp_err_t esp_netif_lwip_ipc_call ( esp_netif_api_fn fn , esp_netif_t * netif , void * data ) { esp_netif_api_msg_t msg = { . esp_netif = netif , . data = data , . api_fn = fn } ; #if ! LWIP_TCPIP_CORE_LOCKING if ( g_lwip_task != xTaskGetCurrentTaskHandle ( ) ) { ESP_LOGD ( TAG , " \n " , netif , fn ) ; sys_arch_sem_wait ( & api_lock_sem , 0 ) ; tcpip_send_msg_wait_sem ( ( tcpip_callback_fn ) esp_netif_api_cb , & msg , & api_sync_sem ) ; sys_sem_signal ( & api_lock_sem ) ; return msg . ret ; } #endif ESP_LOGD ( TAG , " \n " , netif , fn ) ; return fn ( & msg ) ; }
@brief Initiates a tcpip remote call if called from another task
 or calls the function directly if executed from lwip task
@brief Initiates a tcpip remote call if called from another task or calls the function directly if executed from lwip task
/* !LWIP_TCPIP_CORE_LOCKING */