Hi all, I'm fighting with a race condition. I'm calling output.write and transport.close but the call to close sometimes happens on the main thread before the socket thread completes the write:

[Parent 4048037: Main Thread]: D/nsSocketTransport nsSocketTransport::Close 
7fc2ecb6f000 reason=0
[Parent 4048037: Main Thread]: D/nsSocketTransport 
nsSocketInputStream::CloseWithStatus [this=7fc2ecb6f290 reason=80470002]
[Parent 4048037: Main Thread]: D/nsSocketTransport 
nsSocketOutputStream::CloseWithStatus [this=7fc2ecb6f2c8 reason=80470002]
[Parent 4048037: Socket Thread]: D/nsSocketTransport 
nsSocketOutputStream::Write [this=7fc2ecb6f2c8 count=52]

When this happens the receiving end doesn't get all of the data and my tests fail.

How can I be sure the output stream is ready before closing it? There doesn't appear to be any checks in the code. Is this expected behaviour or a bug?

GL

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/ba2e51f5-05fc-4e9a-8cef-17593ecdd17f%40thunderbird.net.

Reply via email to