GDBusConnection: access the exit-on-close flag atomically
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 17 Oct 2011 18:27:23 +0000 (19:27 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 24 Oct 2011 09:40:20 +0000 (10:40 +0100)
commit8df114f5975ac8819a5a16cb4c5492a179cdfa2e
treee16ca60ae8047e700ab85e1ca3281b413e7a239d
parent3a0b60647d8fd3b7ecffd5f79641a1daa9d79299
GDBusConnection: access the exit-on-close flag atomically

This isn't strictly necessary, because in every location where it's
checked, if the reading thread misses an update from another thread,
it's indistinguishable from the reading thread having been scheduled
before the writing thread, which is an unavoidable race condition that
callers need to cope with anyway. On the other hand, merging exit_on_close
into atomic_flags gives the least astonishing semantics to library users
and saves 4 bytes of struct, and if you're accessing exit-on-close often
enough for it to be a performance concern, you're probably doing it wrong.

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>
gio/gdbusconnection.c