lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Core lock check in unix port


From: goldsimon
Subject: Re: [lwip-users] Core lock check in unix port
Date: Thu, 17 Jan 2019 14:48:10 +0100
User-agent: K-9 Mail for Android


Am 17. Januar 2019 12:11:22 MEZ schrieb Jacob Kroon <address@hidden>:
>Hi,
>
>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();
>
>#if LWIP_TCPIP_CORE_LOCKING
>    LWIP_ASSERT("Function called without core lock", current_thread_id
>== lwip_core_lock_holder_thread_id);
>#else /* LWIP_TCPIP_CORE_LOCKING */
>    LWIP_ASSERT("Function called from wrong thread", current_thread_id
>== lwip_tcpip_thread_id);
>#endif /* LWIP_TCPIP_CORE_LOCKING */
>  }
>}
>
>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 ?

It's not encouraged but should work. This is the reason the check is like it 
is...

Simon



reply via email to

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