Hi all,

I just found out that my lwipopts.h was lacking quite a lot, which
completely disabled the core locking assert. After fixing this, I did run
into a few asserts. But all in places where I am not expecting them.

Why do I need to lock for example:

    LOCK_TCPIP_CORE();
    netif_set_default(&pppos_netif);
    ppp = pppos_create(&pppos_netif, ppp_output_cb, ppp_link_status_cb,
nullptr);
    if (!ppp)
    {
        logger.WriteDebug(LoggingCategoryPppClient,
"Failed to create pppos client");
        return;
    }
    ppp_connect(ppp, 0);
    UNLOCK_TCPIP_CORE();

or calls like this

    LOCK_TCPIP_CORE();
    err_t err = httpc_get_file(
        &ip,
        port,
        "/513KB.zip",
        &settings,
        rec_fn,
        nullptr,
        nullptr);
    UNLOCK_TCPIP_CORE();

As far as I understand there I no need at all to make this a user code
responsibility. The lwip functions could perfectly do this first hand *for
me*.

I can imagine a minor performance deal there. But if that's the argument,
it could be made configurable, right? If the user of the library doesn't
want to bother with these locks, at the cost of some unnecessary
lock/unlocks, they could opt for that in the lwipopts.

Would this be something that could be interesting to improve or am I
missing something here?

Best regards, bas
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to