mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-16 03:40:09 +00:00
Rename tcpip_send_api_msg to tcpip_send_msg_wait_sem (hopefully a little bit clearer name)
This commit is contained in:
parent
5f8b5cbb20
commit
d6adc1f6cb
@ -84,7 +84,7 @@ tcpip_apimsg(tcpip_callback_fn fn, struct api_msg *apimsg)
|
||||
apimsg->op_completed_sem = LWIP_NETCONN_THREAD_SEM_GET();
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
|
||||
if (tcpip_send_api_msg(fn, apimsg, LWIP_API_MSG_SEM(apimsg)) == ERR_OK) {
|
||||
if (tcpip_send_msg_wait_sem(fn, apimsg, LWIP_API_MSG_SEM(apimsg)) == ERR_OK) {
|
||||
return apimsg->err;
|
||||
}
|
||||
return ERR_VAL;
|
||||
|
@ -101,7 +101,7 @@ tcpip_thread(void *arg)
|
||||
#if !LWIP_TCPIP_CORE_LOCKING
|
||||
case TCPIP_MSG_API:
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg));
|
||||
msg->msg.api.function(msg->msg.api.msg);
|
||||
msg->msg.api_msg.function(msg->msg.api_msg.msg);
|
||||
break;
|
||||
case TCPIP_MSG_API_CALL:
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API CALL message %p\n", (void *)msg));
|
||||
@ -112,7 +112,7 @@ tcpip_thread(void *arg)
|
||||
sys_sem_signal(&msg->msg.api_call->sem);
|
||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||
break;
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
#endif /* !LWIP_TCPIP_CORE_LOCKING */
|
||||
|
||||
#if !LWIP_TCPIP_CORE_LOCKING_INPUT
|
||||
case TCPIP_MSG_INPKT:
|
||||
@ -120,7 +120,7 @@ tcpip_thread(void *arg)
|
||||
msg->msg.inp.input_fn(msg->msg.inp.p, msg->msg.inp.netif);
|
||||
memp_free(MEMP_TCPIP_MSG_INPKT, msg);
|
||||
break;
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING_INPUT */
|
||||
#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */
|
||||
|
||||
#if LWIP_TCPIP_TIMEOUT
|
||||
case TCPIP_MSG_TIMEOUT:
|
||||
@ -325,7 +325,7 @@ tcpip_untimeout(sys_timeout_handler h, void *arg)
|
||||
* @return ERR_OK if the function was called, another err_t if not
|
||||
*/
|
||||
err_t
|
||||
tcpip_send_api_msg(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem)
|
||||
tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem)
|
||||
{
|
||||
LWIP_ASSERT("semaphore not initialized", sys_sem_valid(sem));
|
||||
|
||||
@ -341,8 +341,8 @@ tcpip_send_api_msg(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem)
|
||||
|
||||
TCPIP_MSG_VAR_ALLOC(msg);
|
||||
TCPIP_MSG_VAR_REF(msg).type = TCPIP_MSG_API;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api.function = fn;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api.msg = apimsg;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_msg.function = fn;
|
||||
TCPIP_MSG_VAR_REF(msg).msg.api_msg.msg = apimsg;
|
||||
sys_mbox_post(&mbox, &TCPIP_MSG_VAR_REF(msg));
|
||||
sys_arch_sem_wait(sem, 0);
|
||||
TCPIP_MSG_VAR_FREE(msg);
|
||||
|
@ -95,7 +95,7 @@ extern sys_mutex_t lock_tcpip_core;
|
||||
#define API_EXPR_DEREF(expr) *(expr)
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
|
||||
err_t tcpip_send_api_msg(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem);
|
||||
err_t tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem);
|
||||
|
||||
struct tcpip_api_call;
|
||||
typedef err_t (*tcpip_api_call_fn)(struct tcpip_api_call* call);
|
||||
@ -131,7 +131,7 @@ struct tcpip_msg {
|
||||
struct {
|
||||
tcpip_callback_fn function;
|
||||
void* msg;
|
||||
} api;
|
||||
} api_msg;
|
||||
struct tcpip_api_call *api_call;
|
||||
struct {
|
||||
struct pbuf *p;
|
||||
|
Loading…
x
Reference in New Issue
Block a user