windows gsocket deadlock
Submitted by Jake Foytik
Link to original bug (#750805)
Description
Using gstreamer's rtsp-server on Windows, I am experiencing frequent lockups where the server will stop transmitting data. I have traced the issue to the g_socket_send_message() function and what appears to be a race condition.
From my tests/debugging, it seems that gstreamer is calling a gsocket's send function from one thread, and calling the same gsocket's receive function from another thread. Everything works fine until we have an instance where the send function starts to post EWOULDBLOCK errors. When this happens we end up with two threads calling the WSAWaitForMultipleEvents() function and competing for the same WSAEvent. The lockup happens when the WSAEvent is cleared just before the WSAWait is called to wait on an FD_WRITE event. This results in waiting for an FD_WRITE event that will never happen again.
Question: According to a previous post (https://bugzilla.gnome.org/show_bug.cgi?id=705027) there is no assumption that a gsocket is thread-safe. Is this still true?
I am not seeing this issue on linux. Is it possibly that the linux implementation of gsocket is thread-safe, while the windows implementation is not?
Version: 2.45.x