]> git.ipfire.org Git - thirdparty/dbus.git/commit
Consistently use atomic operations for all access to DBusConnection refcount
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 10 Jun 2011 17:08:11 +0000 (18:08 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 10 Jun 2011 17:08:11 +0000 (18:08 +0100)
commit50732523a78254b28fad9427c91f774292de69cd
tree35c3dc842fae2466700a0d26a43c31a4693191be
parent73e259322de5d4e46bbac8113ab5dcb38c69dd94
Consistently use atomic operations for all access to DBusConnection refcount

Trying to mix atomic operations with locked non-atomic operations is
broken: the atomic ops aren't necessarily atomic with respect to the
locked non-atomic ops, and the non-atomic ops aren't protected by the
lock because the atomic ops can change the refcount behind their back.

In theory we could use the connection lock if atomic ops aren't supported
(making a per-connection lock cheaper than the global lock used to
implement atomic ops) *and* our mutexes are recursive (making it safe
against deadlocks)... but life's too short.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38005
Tested-by: Will Manley <freedesktop williammanley net>
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
dbus/dbus-connection.c