Commit eb99c288 authored by Thiago Macieira's avatar Thiago Macieira Committed by Oswald Buddenhagen
Browse files

QDBusConnection: Merge the dispatch and the watch-and-timeout locks


We don't need two anymore because they now protect the same thing: the
state of the DBusConnection. The difference existed when it was possible
for two threads to access the DBusConnection at the same time: one doing
dispatching and one doing something else. Unfortunately, even though
DBusConnection supports this, QtDBus doesn't.

From d47c05b1889bb4f06203bbc65f4660b8d0128954 (2008-10-08):
   Details:  if we're removing a timer or a watcher from our list,
   there's a race condition: one thread (not the QDBusConnection thread)
   could be asking for the removal (which causes an event to be sent),
   then deletes the pointer. In the meantime, QDBusConnection will
   process the timers and socket notifiers and could end up calling
   lidbus-1 with deleted pointers.

That commit fixed the race condition but introduced a deadlock.

Task-number: QTBUG-42189
Change-Id: I034038f763cbad3a67398909defd31a23c27c965
Reviewed-by: default avatarJędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: default avatarAlbert Astals Cid <albert.astals@canonical.com>
Reviewed-by: default avatarFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>
No related merge requests found
Showing with 16 additions and 29 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment