]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
2007-07-10 Havoc Pennington <hp@redhat.com>
authorHavoc Pennington <hp@redhat.com>
Tue, 10 Jul 2007 16:00:44 +0000 (16:00 +0000)
committerHavoc Pennington <hp@redhat.com>
Tue, 10 Jul 2007 16:00:44 +0000 (16:00 +0000)
* 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)

ChangeLog
dbus/dbus-connection.c

index 7b70bc642146e7b5773522a6ce86270ab74a8229..ce6ac551d21a0c8feb064d84ecadb9ac3ba21305 100644 (file)
--- 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-07-09  Ralf Habacker  <ralf.habacker@freenet.de>
 
        * dbus/dbus-sysdeps-win.c,dbus-sysdeps-win.h,dbus-sysdeps-win-util.c,
index 62ef3dac0e9b98311f2779119bdfb77195dd5885..de6952475dbc8debc47f9eacac8bcf4f7504b618 100644 (file)
@@ -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 */