From 83cde938ec2798829e469f2a4eeea2cf0529b6f3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 25 Feb 2011 17:32:38 +0000 Subject: [PATCH 07/10] Don't inline the contents of _dbus_connection_unlock It's about to become more complex, to handle delayed deallocation of messages in order to avoid triggering callbacks while locked. --- dbus/dbus-connection.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index 4d08204..f1ff904 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -69,11 +69,7 @@ TOOK_LOCK_CHECK (connection); \ } while (0) -#define CONNECTION_UNLOCK(connection) do { \ - if (TRACE_LOCKS) { _dbus_verbose ("UNLOCK\n"); } \ - RELEASING_LOCK_CHECK (connection); \ - _dbus_mutex_unlock ((connection)->mutex); \ - } while (0) +#define CONNECTION_UNLOCK(connection) _dbus_connection_unlock (connection) #define SLOTS_LOCK(connection) do { \ _dbus_mutex_lock ((connection)->slot_mutex); \ @@ -380,7 +376,13 @@ _dbus_connection_lock (DBusConnection *connection) void _dbus_connection_unlock (DBusConnection *connection) { - CONNECTION_UNLOCK (connection); + if (TRACE_LOCKS) + { + _dbus_verbose ("UNLOCK\n"); + } + + RELEASING_LOCK_CHECK (connection); + _dbus_mutex_unlock (connection->mutex); } /** -- 1.7.4.1