diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2006-09-14 04:26:00 +0000 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2006-09-14 04:26:00 +0000 |
commit | 57ab23491c8c80b4a1606ea3b72e179c1b742bb9 (patch) | |
tree | 2e1c63b4be9d4a7b22cb9473dab60a68f921edf0 /dbus/dbus-dataslot.c | |
parent | f82bdd3ab39cc5741189a4ab16dc3533a79c6617 (diff) |
* 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
Diffstat (limited to 'dbus/dbus-dataslot.c')
-rw-r--r-- | dbus/dbus-dataslot.c | 9 |
1 files changed, 3 insertions, 6 deletions
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); |