[patch] Change assert to a detailed warning and abort
Havoc Pennington
hp at redhat.com
Wed Aug 9 12:29:28 PDT 2006
John (J5) Palmieri wrote:
> Now that Gnome-VFS has started to use D-Bus and is heavily threaded
> people have been running into the allocator->lock == mutex assert a lot.
> This is due to them not initializing threads early in the game usually
> as a side effect of loading Gnome-VFS through a plugin.
>
> This patch changes the assert to be a more detailed warning and an abort
> since it is a user error an not the fault of the library itself. Is
> this the right way to handle this or is there a better way? Also read
> over the verbiage to make sure it is clear. Thanks.
>
Remember to add braces to the patch so the warn/abort are in the same block.
Some possible wording:
"D-Bus threads were initialized after first using the D-Bus library. If
your application does not directly init 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."
Havoc
More information about the dbus
mailing list