_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)
{
* are disabled, since then the asserts are empty.
*/
if (!_dbus_mutex_lock (allocator->lock))
- return FALSE;
+ return NULL;
_dbus_assert (slot >= 0);
_dbus_assert (slot < allocator->n_allocated_slots);
_dbus_assert (allocator->allocated_slots[slot].slot_id == slot);