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 /dbus/dbus-userdb.h | |
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 'dbus/dbus-userdb.h')
-rw-r--r-- | dbus/dbus-userdb.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dbus/dbus-userdb.h b/dbus/dbus-userdb.h index cb49d9e7..d6b72d8c 100644 --- a/dbus/dbus-userdb.h +++ b/dbus/dbus-userdb.h @@ -86,7 +86,7 @@ void _dbus_group_info_free_allocated (DBusGroupInfo *info); #endif /* DBUS_USERDB_INCLUDES_PRIVATE */ DBusUserDatabase* _dbus_user_database_get_system (void); -void _dbus_user_database_lock_system (void); +dbus_bool_t _dbus_user_database_lock_system (void) _DBUS_GNUC_WARN_UNUSED_RESULT; void _dbus_user_database_unlock_system (void); void _dbus_user_database_flush_system (void); |