dbus_g_thread_init()

Thiago Macieira thiago at kde.org
Wed Sep 13 11:04:01 PDT 2006


Havoc Pennington wrote:
>The thread init function exists for only two reasons:
>  - possible performance concerns
>  - dbus not having built-in thread primitives, so someone had to
>    provide the glib or qt ones

Just because you mentioned, QtDBus initialises D-Bus threads on first use 
and stores the state in a static variable. 

In any event, I'd welcome the internal threading mechanism for D-Bus. I 
think linking to libpthread has to be accepted for any application.

But dbus_threads_init isn't the problem: dbus_shutdown is. It's not tied 
to the threading mechanism, but is required to properly free memory (and, 
hence, to get the leaked memory warnings away from Valgrind). QtDBus will 
always call dbus_shutdown when it gets unloaded. In turn, that means that 
a program using libdbus or libdbus-glib that loads a QtDBus-based plugin 
will face problems, because it'll shut the library down.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060913/761d7ac9/attachment.pgp


More information about the dbus mailing list