Am 17. Januar 2019 12:11:22 MEZ schrieb Jacob Kroon <[email protected]>:
>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

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to