Revert "Rename authorized_identity in authenticated_identity for clarity sake."
[platform/upstream/dbus.git] / dbus / dbus-pending-call.c
index 8a9d2f4..1604408 100644 (file)
@@ -489,8 +489,8 @@ _dbus_pending_call_get_completed_unlocked (DBusPendingCall    *pending)
   return pending->completed;
 }
 
-static DBusDataSlotAllocator slot_allocator;
-_DBUS_DEFINE_GLOBAL_LOCK (pending_call_slots);
+static DBusDataSlotAllocator slot_allocator =
+  _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (pending_call_slots));
 
 /**
  * Stores a pointer on a #DBusPendingCall, along
@@ -631,6 +631,8 @@ dbus_pending_call_set_notify (DBusPendingCall              *pending,
                               void                         *user_data,
                               DBusFreeFunction              free_user_data)
 {
+  dbus_bool_t ret = FALSE;
+
   _dbus_return_val_if_fail (pending != NULL, FALSE);
 
   CONNECTION_LOCK (pending->connection);
@@ -638,13 +640,15 @@ dbus_pending_call_set_notify (DBusPendingCall              *pending,
   /* could invoke application code! */
   if (!_dbus_pending_call_set_data_unlocked (pending, notify_user_data_slot,
                                              user_data, free_user_data))
-    return FALSE;
+    goto out;
   
   pending->function = function;
+  ret = TRUE;
 
+out:
   CONNECTION_UNLOCK (pending->connection);
   
-  return TRUE;
+  return ret;
 }
 
 /**
@@ -764,7 +768,6 @@ dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p)
   _dbus_return_val_if_fail (slot_p != NULL, FALSE);
 
   return _dbus_data_slot_allocator_alloc (&slot_allocator,
-                                          &_DBUS_LOCK_NAME (pending_call_slots),
                                           slot_p);
 }