summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2007-07-10 16:00:44 +0000
committerHavoc Pennington <hp@redhat.com>2007-07-10 16:00:44 +0000
commitfbd1ded1d6fbe94c6188934245f8a4f14ec52e84 (patch)
tree7b07984e8b10d9c6bdbac7a23daee22727092604
parent1bd4ecc1256f38d7ab0da736434d46762507348b (diff)
downloaddbus-fbd1ded1d6fbe94c6188934245f8a4f14ec52e84.tar.gz
2007-07-10 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c (struct DBusConnection): Fix from Olivier Hochreutiner to avoid trying to protect individual bits in a word with different locks (make dispatch_acquired and io_path_acquired dbus_bool_t rather than bitfields)
-rw-r--r--ChangeLog7
-rw-r--r--dbus/dbus-connection.c10
2 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d9d6e66f..d3c20041 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-07-10 Havoc Pennington <hp@redhat.com>
+
+ * dbus/dbus-connection.c (struct DBusConnection): Fix from Olivier
+ Hochreutiner to avoid trying to protect individual bits in a word
+ with different locks (make dispatch_acquired and io_path_acquired
+ dbus_bool_t rather than bitfields)
+
2007-06-08 Havoc Pennington <hp@redhat.com>
* backport fix to allow a server to use port=0 or omit port so
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 5dc463a4..1fef2b6c 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -281,10 +281,14 @@ struct DBusConnection
char *server_guid; /**< GUID of server if we are in shared_connections, #NULL if server GUID is unknown or connection is private */
+ /* These two MUST be bools and not bitfields, because they are protected by a separate lock
+ * from connection->mutex and all bitfields in a word have to be read/written together.
+ * So you can't have a different lock for different bitfields in the same word.
+ */
+ dbus_bool_t dispatch_acquired; /**< Someone has dispatch path (can drain incoming queue) */
+ dbus_bool_t io_path_acquired; /**< Someone has transport io path (can use the transport to read/write messages) */
+
unsigned int shareable : 1; /**< #TRUE if libdbus owns a reference to the connection and can return it from dbus_connection_open() more than once */
-
- unsigned int dispatch_acquired : 1; /**< Someone has dispatch path (can drain incoming queue) */
- unsigned int io_path_acquired : 1; /**< Someone has transport io path (can use the transport to read/write messages) */
unsigned int exit_on_disconnect : 1; /**< If #TRUE, exit after handling disconnect signal */