summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusthreaddebug_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-03-27 17:10:36 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-03-27 20:55:28 (GMT)
commitb410a39fad176593ed75b742a486f8710c6ef60f (patch)
treeb4559d7bb3335feb60c95cff37787900a66c9c69 /src/dbus/qdbusthreaddebug_p.h
parentec24cf81e231974fde2bb4903a00e63abce6465b (diff)
downloadQt-b410a39fad176593ed75b742a486f8710c6ef60f.zip
Qt-b410a39fad176593ed75b742a486f8710c6ef60f.tar.gz
Qt-b410a39fad176593ed75b742a486f8710c6ef60f.tar.bz2
Fix crashes in D-Bus due to race conditions.
This happens in heavily threaded applications: libdbus-1 asks us to add and remove timers (and watches, but those less often) from any thread. Since QObject's model requires that timers and QSocketDescriptors be added only in the object's own thread, we have to sync back to the main thread. However, since D-Bus keeps adding and removing the timers, we have to keep a queue of timers to be added and that list is accessed by any thread. Make sure that list is only accessed in locked conditions. Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/dbus/qdbusthreaddebug_p.h')
-rw-r--r--src/dbus/qdbusthreaddebug_p.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h
index 715bd6f..20d819f 100644
--- a/src/dbus/qdbusthreaddebug_p.h
+++ b/src/dbus/qdbusthreaddebug_p.h
@@ -92,9 +92,10 @@ enum ThreadAction {
PendingCallBlockAction = 28,
AddTimeoutAction = 50,
- RemoveTimeoutAction = 51,
- KillTimerAction = 52,
- TimerEventAction = 53,
+ RealAddTimeoutAction = 51,
+ RemoveTimeoutAction = 52,
+ KillTimerAction = 58,
+ TimerEventAction = 59,
AddWatchAction = 60,
RemoveWatchAction = 61,
ToggleWatchAction = 62,