[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #20288] event_callback is called from multiple threads
From: |
Frédéric Bernon |
Subject: |
[lwip-devel] [bug #20288] event_callback is called from multiple threads without locking |
Date: |
Sat, 30 Jun 2007 15:19:42 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 |
Follow-up Comment #1, bug #20288 (project lwip):
There is also a call in netconn_accept. For netconn_recv, for the TCP part, I
think it's easy to move the callback inside the do_recv. For the RAW/UDP part,
there is no such call (do_recv), so, add one will add a thread-context switch,
and it's not a good idea.
Tips for LWIP_SOCKETS_SELECT & LWIP_NONBLOCKING_SOCKETS (from patch#5919): to
avoid calls, it will be good to use a define like :
#if LWIP_SOCKETS_SELECT || LWIP_NONBLOCKING_SOCKETS
#define API_CALLBACK(conn,evt,len) {if (conn->callback) conn->callback( conn,
evt, len);}
#else /* LWIP_SOCKETS_SELECT || LWIP_NONBLOCKING_SOCKETS */
#define API_CALLBACK(conn,evt,len)
#endif /* LWIP_SOCKETS_SELECT || LWIP_NONBLOCKING_SOCKETS */
And replace all "conn->callback" by API_CALLBACK...
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?20288>
_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/