Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.1
-
None
-
a77ab4c4dd3c0d9c5cf71afc4d3efcc76a068430
Description
It's about setting "quitNow" flag in the QThread::exec() and checking this flag in the QEvenLoop::exec().
The QThread::quit() can tell the loop to quit in two ways: setting "quitNow" flag it there's no loop yet and posting a message into the loop if it already exists.
There's unprotected area in the QEventLoop::exec() (qeventloop.cpp, lines 180-186) where the flag is ALREADY checked but the loop message queue DOESN'T EXIST yet (d->threadData->eventLoops.push(this) not called yet).
If the execution point being in this area and the thread's quit() method is called from another thread, this request is lost, because the flag won't be checked again and queue not accepting messages yet.
Test Case is attached. The problem arises randomly though.
Attachments
Issue Links
- relates to
-
QTBUG-1184 Race condition in QThread
- Closed