summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-dataslot.c
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-08-09 19:45:24 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2006-08-09 19:45:24 +0000
commit5628ef82de9e853381ab61bab8c3cd3b1b622290 (patch)
treeae9a9382a9bcec48bfea48d4a0ea1079a9cc6ecf /dbus/dbus-dataslot.c
parent10b79991cc13b8b9347c19db840e50d6f5ede4fb (diff)
* Change an assert to a detailed warning and abort.
When allocator->lock != mutex it indicates that the user has failed to initalize threads before using the D-Bus library. This warning helps the user identify the issue and fix their app.
Diffstat (limited to 'dbus/dbus-dataslot.c')
-rw-r--r--dbus/dbus-dataslot.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dbus/dbus-dataslot.c b/dbus/dbus-dataslot.c
index 8a2937de..8b1bbb87 100644
--- a/dbus/dbus-dataslot.c
+++ b/dbus/dbus-dataslot.c
@@ -78,8 +78,11 @@ _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator,
_dbus_assert (allocator->lock == NULL);
allocator->lock = mutex;
}
- else
- _dbus_assert (allocator->lock == mutex);
+ else if (allocator->lock != mutex)
+ {
+ _dbus_warn ("D-Bus threads were initialized after first using the D-Bus library. If your application does not directly initialize threads or use D-Bus, keep in mind that some library or plugin may have used D-Bus or initialized threads behind your back. You can often fix this problem by calling dbus_init_threads() or dbus_g_threads_init() early in your main() method, before D-Bus is used.");
+ _dbus_abort ();
+ }
if (*slot_id_p >= 0)
{