Thread safety

Havoc Pennington hp at redhat.com
Tue Sep 11 13:12:28 PDT 2007


Hi,

On 9/11/07, Thiago Macieira <thiago at kde.org> wrote:
> I would say that some functions aren't meant to be thread-safe and  I
> would qualify connection setup functions as such.
>
> You should finish setting up the connection (connect, handshake, set
> timeout and watch callbacks) before any other thread gets to use the
> connection.
>

The bug here is in the "toggle" function though (timeout turned on and
off), iirc.
i.e. the problem is in libdbus calling the callbacks, rather than the
app setting them. Either way the libdbus code is clearly messed up.
(The simplest fix as mentioned in that earlier thread is to not drop
the connection lock in this spot, which is probably good enough.)

Havoc


More information about the dbus mailing list