From 57ab23491c8c80b4a1606ea3b72e179c1b742bb9 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Thu, 14 Sep 2006 04:26:00 +0000 Subject: * dbus/dbus-threads.c: Allow recursive mutex's to be passed into dbus_threads_init and be used by the dbus mutex functions to avoid deadlocks. * doc/TODO: Remove recursive mutex dbus_connection_dispatch TODO item --- dbus/dbus-dataslot.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'dbus/dbus-dataslot.c') diff --git a/dbus/dbus-dataslot.c b/dbus/dbus-dataslot.c index d53f3bd7..f9c12f84 100644 --- a/dbus/dbus-dataslot.c +++ b/dbus/dbus-dataslot.c @@ -70,8 +70,7 @@ _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator, { dbus_int32_t slot; - if (!_dbus_mutex_lock (*mutex_loc)) - return FALSE; + _dbus_mutex_lock (*mutex_loc); if (allocator->n_allocated_slots == 0) { @@ -246,8 +245,7 @@ _dbus_data_slot_list_set (DBusDataSlotAllocator *allocator, * be e.g. realloc()ing allocated_slots. We avoid doing this if asserts * are disabled, since then the asserts are empty. */ - if (!_dbus_mutex_lock (*(allocator->lock_loc))) - return FALSE; + _dbus_mutex_lock (*(allocator->lock_loc)); _dbus_assert (slot < allocator->n_allocated_slots); _dbus_assert (allocator->allocated_slots[slot].slot_id == slot); _dbus_mutex_unlock (*(allocator->lock_loc)); @@ -304,8 +302,7 @@ _dbus_data_slot_list_get (DBusDataSlotAllocator *allocator, * be e.g. realloc()ing allocated_slots. We avoid doing this if asserts * are disabled, since then the asserts are empty. */ - if (!_dbus_mutex_lock (*(allocator->lock_loc))) - return NULL; + _dbus_mutex_lock (*(allocator->lock_loc)); _dbus_assert (slot >= 0); _dbus_assert (slot < allocator->n_allocated_slots); _dbus_assert (allocator->allocated_slots[slot].slot_id == slot); -- cgit