Implement LWIP core locking support in tcpip_callback_with_block()
Created two new functions for API cleanup: tcpip_callback() that blocks until message is posted, cannot be called from IRQs. tcpip_try_callback() that does not block and just tries to post a message. Can be called from IRQs. Add compatibility #define tcpip_callback_with_block() that maps to these two functions according to "block" parameter.
This commit is contained in:
@@ -77,12 +77,10 @@ void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg);
|
||||
err_t tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn);
|
||||
err_t tcpip_input(struct pbuf *p, struct netif *inp);
|
||||
|
||||
err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block);
|
||||
/**
|
||||
* @ingroup lwip_os
|
||||
* @see tcpip_callback_with_block
|
||||
*/
|
||||
#define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1)
|
||||
err_t tcpip_try_callback(tcpip_callback_fn function, void *ctx);
|
||||
err_t tcpip_callback(tcpip_callback_fn function, void *ctx);
|
||||
/* for compatibility with older lwIP versions */
|
||||
#define tcpip_callback_with_block(function, ctx, block) ((block != 0)? tcpip_callback(function, ctx) : tcpip_try_callback(function, ctx))
|
||||
|
||||
struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx);
|
||||
void tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg);
|
||||
|
||||
Reference in New Issue
Block a user