Simon McVittie a031bacaac GDBusConnection: make the closed flag atomic (but still lock to write)
Strictly speaking, neither of the two uses that aren't under the lock
*needs* to be atomic, but it seems better to be obviously correct (and
we save another 4 bytes of struct).

One of these uses is in g_dbus_connection_is_closed(), any use of which
is inherently a race condition anyway.

The other is g_dbus_connection_flush_sync, which as far as I can tell
just needs a best-effort check, to not waste effort on a connection that
has been closed for a while (but I could be wrong).

I removed the check for the closed flag altogether in
g_dbus_connection_send_message_with_reply_unlocked, because it turns out
to be redundant with one in g_dbus_connection_send_message_unlocked,
which is called immediately after.

g_dbus_connection_close_sync held the lock to check the closed flag,
which is no longer needed.

As far as I can tell, the only reason why the lock is still desirable
when setting the closed flag is so that remove_match_rule can't fail
by racing with close notification from the worker thread - but
on_worker_closed needs to hold the lock anyway, to deal with other
data structures, so there's no point in trying to eliminate the
requirement to hold the lock.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661992
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
2011-10-24 10:40:26 +01:00
..
2011-10-18 17:12:33 +01:00
2010-08-13 17:23:44 -04:00
2010-09-02 22:36:47 +03:00
2011-09-04 17:50:41 -04:00
2011-06-12 16:17:30 -04:00
2011-06-04 10:45:54 -04:00
2009-03-31 19:39:16 -04:00
2011-08-29 14:49:32 -04:00
2011-10-16 21:41:15 -04:00
2011-10-18 17:12:33 +01:00
2011-08-29 14:49:32 -04:00
2011-08-29 14:49:32 -04:00
2010-07-12 18:30:14 -04:00
2011-10-18 17:12:33 +01:00
2011-06-04 19:05:51 -04:00
2010-07-05 00:56:12 -04:00
2011-08-29 14:49:32 -04:00
2010-03-26 09:30:25 -04:00
2010-07-12 18:30:14 -04:00
2010-07-12 18:30:14 -04:00
2011-08-29 14:49:32 -04:00
2010-07-12 18:30:14 -04:00
2011-06-14 21:06:17 -04:00
2011-10-18 17:12:33 +01:00
2011-10-18 17:12:33 +01:00
2010-07-07 19:53:22 -04:00
2011-10-15 18:02:32 -04:00
2011-08-29 14:49:32 -04:00
2011-08-29 14:49:32 -04:00
2011-10-15 18:02:32 -04:00
2011-08-29 14:49:32 -04:00
2011-06-04 18:48:19 -04:00
2011-08-29 14:49:32 -04:00
2011-08-29 14:49:32 -04:00
2010-01-12 16:34:18 +01:00
2011-06-07 08:55:31 +08:00
2011-10-16 21:41:15 -04:00
2011-08-29 14:49:32 -04:00
2011-10-16 21:41:15 -04:00
2011-08-29 14:49:32 -04:00
2011-09-04 17:50:41 -04:00
2010-07-10 18:04:22 -04:00
2010-07-07 19:53:22 -04:00
2011-02-08 10:05:00 -05:00
2011-10-16 21:41:15 -04:00
2011-10-16 21:41:15 -04:00
2011-02-08 10:05:00 -05:00
2010-11-28 23:55:43 -05:00
2010-06-04 19:03:38 +02:00
2011-10-18 17:12:33 +01:00
2010-11-28 23:55:43 -05:00
2011-06-04 18:48:19 -04:00
2010-08-19 16:32:37 -04:00
2011-08-29 14:49:32 -04:00
2011-08-29 14:49:32 -04:00
2011-01-09 21:45:20 +01:00
2011-08-29 14:49:32 -04:00
2010-04-16 23:23:40 -04:00
2011-10-18 17:12:33 +01:00
2011-10-16 21:41:15 -04:00
2011-10-16 21:41:15 -04:00
2011-08-29 14:49:32 -04:00
2011-10-18 17:12:33 +01:00
2011-10-16 21:41:15 -04:00
2011-10-16 21:41:15 -04:00
2011-10-16 21:41:15 -04:00
2011-08-04 08:54:55 +02:00
2011-10-16 21:41:15 -04:00
2011-08-26 11:07:32 -04:00
2011-10-02 22:33:10 -04:00
2011-06-14 18:51:57 -04:00
2011-05-05 14:09:11 -04:00
2011-10-03 14:06:47 -04:00
2011-10-03 14:06:47 -04:00
2009-07-05 22:35:55 -04:00
2010-07-12 18:30:14 -04:00
2011-08-29 14:49:32 -04:00
2010-07-07 19:53:22 -04:00
2011-08-29 14:49:32 -04:00