The answer is simple: using two threads on the same socket is not supported by
lwIP.
http://lwip.wikia.com/wiki/LwIP_and_multithreading
----- Original Message -----
From: Emmanuel Baguia Jr.
To: lwIP
Sent: Sunday, September 13, 2009 3:05 AM
Subject: [lwip-users] Issue in closing blocked sockets
Hello,
I have this implementation that uses 2 threads. One is opening a socket
and the other will trigger the close socket.
In the first thread, I call recvfrom, and it is blocking at some point
in the sys_arch_mbox_fetch(). Now, if the other thread will close(calling
lwip_close) the socket, recvfrom() will not be able to continue since it is
blocking. Do you have any idea how to handle this scenario in lwIP?
The issue is when we call lwip_close; there is an assertion "Error
releasing mutex". What we did is, we see in the netconn_recv function it is
using conn->recvmbox as its object. So, in lwip_close we call
sys_mbox_post(recvmbox, NULL) before netconn_delete(sock->conn). The operation
continues as we expected but at somepoint our application stops. Maybe this is
not right thing to do? Please advice.
Thanks.
------------------------------------------------------------------------------
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users