MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / tcpip_callback

Function tcpip_callback

components/net/lwip/lwip-2.1.2/src/api/tcpip.c:308–326  ·  view source on GitHub ↗

* @ingroup lwip_os * Call a specific function in the thread context of * tcpip_thread for easy access synchronization. * A function called in that way may access lwIP core code * without fearing concurrent access. * Blocks until the request is posted. * Must not be called from interrupt context! * * @param function the function to call * @param ctx parameter passed to f * @return ERR_OK

Source from the content-addressed store, hash-verified

306 * @see tcpip_try_callback
307 */
308err_t
309tcpip_callback(tcpip_callback_fn function, void *ctx)
310{
311 struct tcpip_msg *msg;
312
313 LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(tcpip_mbox));
314
315 msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
316 if (msg == NULL) {
317 return ERR_MEM;
318 }
319
320 msg->type = TCPIP_MSG_CALLBACK;
321 msg->msg.cb.function = function;
322 msg->msg.cb.ctx = ctx;
323
324 sys_mbox_post(&tcpip_mbox, msg);
325 return ERR_OK;
326}
327
328/**
329 * @ingroup lwip_os

Callers 11

lwip_getsockoptFunction · 0.85
lwip_setsockoptFunction · 0.85
netif_loop_outputFunction · 0.85
netconn_gethostbynameFunction · 0.85
lwip_getsockoptFunction · 0.85
lwip_setsockoptFunction · 0.85
netconn_gethostbynameFunction · 0.85
lwip_getsockoptFunction · 0.85
lwip_setsockoptFunction · 0.85

Calls 1

sys_mbox_postFunction · 0.50

Tested by

no test coverage detected