qt5base-lts/tests/auto/other
Denis Kormalev f24cc53cc2 Fix for race condition in signal activation
There was a race condition between QObject::disconnect() and
QMetaObject::activate() which can occur if there are multiple
BlockingQueued connections to one signal from different threads and
they connect/disconnect their connections often.

What can happen in this case is:
T1 is in activate() method and T2 is in disconnect() method

T1                          T2
locks sender mutex
selects next connection
unlocks sender mutex
                            locks sender mutex
                            sets isSlotObject to false
creates QMetaCallEvent      derefs connection
posts event

Two things can happen here:
1. Connection can still be valid, but it will have isSlotObject==false
and callFunction will be used instead of slotObj
2. Connection can already be invalid

To fix it mutex unlock should be moved after QMetaCallEvent creation.

Also there is another case, when we don't disconnect but delete the
receiver object. In this case it can already be invalid during
postEvent, so we need to move mutex unlock after postEvent.

Change-Id: I8103798324140ee11de5b4e10906562ba878ff8b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-07-29 06:09:22 +00:00
..
android Update copyright headers 2015-02-11 06:49:51 +00:00
atwrapper Update copyright headers 2015-02-11 06:49:51 +00:00
compiler Force the use of the C++11 alignof keyword instead of an extension 2016-05-29 18:45:13 +00:00
gestures Autotest: Enable make check on rhel 7.1 2016-02-11 05:47:38 +00:00
lancelot Fixup for text labels in lancelot graphics test 2016-03-31 10:27:39 +00:00
languagechange Tests: Always verify whether QTemporaryDir/File creation succeeded. 2015-09-28 15:05:43 +00:00
macgui don't rely on transitive dependencies 2016-01-08 18:51:02 +00:00
macnativeevents Fix OS X 10.11 (Xcode 7.1) build issues due to strongly typed enums 2015-11-16 14:26:43 +00:00
macplist Update copyright headers 2015-02-11 06:49:51 +00:00
modeltest Various tests: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b). 2015-07-28 13:18:55 +00:00
networkselftest Merge remote-tracking branch 'origin/5.5' into 5.6 2016-01-19 10:03:01 +01:00
qaccessibility Merge remote-tracking branch 'origin/5.5' into 5.6 2015-08-26 20:06:57 +02:00
qaccessibilitylinux Enable tst_qaccessibilitylinux 2015-09-26 00:50:44 +00:00
qaccessibilitymac Fix OS X 10.11 (Xcode 7.1) build issues due to strongly typed enums 2015-11-16 14:26:43 +00:00
qcomplextext Various tests: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b). 2015-07-28 13:18:55 +00:00
qfocusevent Update copyright headers 2015-02-11 06:49:51 +00:00
qnetworkaccessmanager_and_qprogressdialog Update copyright headers 2015-02-11 06:49:51 +00:00
qobjectperformance Update copyright headers 2015-02-11 06:49:51 +00:00
qobjectrace Fix for race condition in signal activation 2016-07-29 06:09:22 +00:00
qprocess_and_guieventloop tst_QProcess_and_GuiEventLoop: Added flag QT_NO_PROCESS 2015-09-09 07:15:15 +00:00
qsharedpointer_and_qwidget Update copyright headers 2015-02-11 06:49:51 +00:00
qtokenautomaton Update copyright headers 2015-02-11 06:49:51 +00:00
qvariant_common Update copyright headers 2015-02-11 06:49:51 +00:00
toolsupport Enable a test for QFilePrivate::fileName offset on 32 bit Linux 2015-12-23 14:36:15 +00:00
windowsmobile Various tests: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b). 2015-07-28 13:18:55 +00:00
other.pro Fix tests for build with -no-gui 2016-03-23 06:52:46 +00:00