This commit is contained in:
2026-03-14 21:14:26 +08:00
parent b8dbaa619d
commit c4c95b2a3b
2 changed files with 21 additions and 0 deletions
@@ -428,3 +428,20 @@ void qdx_port_tcp_close(qdx_socket_t sock)
ring_init(&ctx->rx_ring);
free_sock_ctx(ctx);
}
/* ============================================================
* WCHNET global lock — exposed for task_wchnet_entry in main.c
* All WCHNET API calls must be serialized through this mutex.
* ============================================================ */
void qdx_port_net_lock(void)
{
if (g_wchnet_mutex)
xSemaphoreTake(g_wchnet_mutex, portMAX_DELAY);
}
void qdx_port_net_unlock(void)
{
if (g_wchnet_mutex)
xSemaphoreGive(g_wchnet_mutex);
}