[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Core lock check in unix port

From: Jacob Kroon
Subject: [lwip-users] Core lock check in unix port
Date: Thu, 17 Jan 2019 12:11:22 +0100


I apologize beforehand if the text looks like garbage, I'm pasting in gmail..

I'm looking at the core lock check in the unix port:

void sys_check_core_locking(void)
  /* Embedded systems should check we are NOT in an interrupt context here */

  if (lwip_tcpip_thread_id != 0) {
    pthread_t current_thread_id = pthread_self();

    LWIP_ASSERT("Function called without core lock", current_thread_id
== lwip_core_lock_holder_thread_id);
    LWIP_ASSERT("Function called from wrong thread", current_thread_id
== lwip_tcpip_thread_id);

Would it make sense to unconditionally check the thread ids when using
LWIP_TCPIP_CORE_LOCKING, since lwip_tcpip_thread_id is not used in the
check in that configuration ?

Is it allowed to call into LWIP API before the "tcpip_input" thread
has started executing ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]