qt5base-lts/tests/auto/dbus/qdbuspendingcall
Thiago Macieira c2049f67e4 Use a dedicated thread for handling incoming libdbus-1 events
Each application will have one thread dedicated for this, for all
QDBusConnections. I wouldn't mind sharing such a thread with other uses
in Qt, provided none of them ever block (the QProcessManager thread
comes to mind, but it's going away soon).

The cost associated with this change in this commit is so far rather
minimal. All incoming D-Bus calls need to be handled after an event is
posted anyway, to avoid deadlocking on reentering libdbus-1 functions
that acquire locks still held. The cost is the one more thread running
and the cost of synchronizing them when an event is posted.

The benefits far outweigh that cost: no longer will we have problems of
QtDBus failing to run if the main system or session connections are used
before QCoreApplication is run. Moreover, events can be received and
handled in aux threads even if the main thread is blocked on some
operation.

Note: this commit may not be testable (tst_qdbusconnection may fail)

Task-number: QTBUG-43585
Change-Id: Ic5d393bfd36e48a193fcffff13b737556ccd11a8
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-15 02:08:36 +00:00
..
.gitignore Moved dbus autotests into new directory structure 2011-09-01 09:37:08 +02:00
qdbuspendingcall.pro Tests: remove insignificant flag for dbus tests on osx 2015-03-27 18:37:30 +00:00
tst_qdbuspendingcall.cpp Use a dedicated thread for handling incoming libdbus-1 events 2015-09-15 02:08:36 +00:00