Skip to content
Snippets Groups Projects
Commit 2b843cad authored by Cervantes Yu's avatar Cervantes Yu
Browse files

Bug 756036 - Fix race condition between rilworker and IO thread. r=kmachulis

parent ad4e2a3e
No related branches found
No related tags found
No related merge requests found
......@@ -320,11 +320,19 @@ RilClient::OnFileCanWriteWithoutBlocking(int fd)
MOZ_ASSERT(fd == mSocket.get());
while (!mOutgoingQ.empty() || mCurrentRilRawData != NULL) {
if(!mCurrentRilRawData) {
mCurrentRilRawData = mOutgoingQ.front();
mOutgoingQ.pop();
mCurrentWriteOffset = 0;
while (true) {
{
MutexAutoLock lock(mMutex);
if (mOutgoingQ.empty() && !mCurrentRilRawData) {
return;
}
if(!mCurrentRilRawData) {
mCurrentRilRawData = mOutgoingQ.front();
mOutgoingQ.pop();
mCurrentWriteOffset = 0;
}
}
const uint8_t *toWrite;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment