diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-04-16 16:28:44 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-06-17 17:00:00 +0100 |
commit | 2b3272c75ae48c93911bd6f656965cf77d6de3e8 (patch) | |
tree | c612839ca6bf80883028d7e39c7c894d8c56b900 /bus | |
parent | c80c20af46c5f43dcbe672f2c6d8aec0e7f2bbd6 (diff) | |
download | dbus-2b3272c75ae48c93911bd6f656965cf77d6de3e8.tar.gz |
Make taking a global lock automatically initialize locking if needed
This lets them be thread-safe by default, at the cost that they can
now fail.
init_uninitialized_locks() and init_global_locks() must now both
reimplement the equivalent of _dbus_register_shutdown_func(), by using
_dbus_platform_rmutex_lock() on the same underlying mutex around a call
to _dbus_register_shutdown_func_unlocked().
This is because if they used the usual _DBUS_LOCK() API (as
_dbus_register_shutdown_func() does), it would automatically try to
initialize global locking, leading to infinite recursion.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
Reviewed-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'bus')
-rw-r--r-- | bus/stats.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bus/stats.c b/bus/stats.c index 28fd49ba..45531910 100644 --- a/bus/stats.c +++ b/bus/stats.c @@ -203,8 +203,8 @@ bus_stats_handle_get_stats (DBusConnection *connection, if (!asv_add_uint32 (&iter, &arr_iter, "Serial", stats_serial++)) goto oom; - _dbus_list_get_stats (&in_use, &in_free_list, &allocated); - if (!asv_add_uint32 (&iter, &arr_iter, "ListMemPoolUsedBytes", in_use) || + if (!_dbus_list_get_stats (&in_use, &in_free_list, &allocated) || + !asv_add_uint32 (&iter, &arr_iter, "ListMemPoolUsedBytes", in_use) || !asv_add_uint32 (&iter, &arr_iter, "ListMemPoolCachedBytes", in_free_list) || !asv_add_uint32 (&iter, &arr_iter, "ListMemPoolAllocatedBytes", |