Problems with dbus_fake_mutex
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Thu Nov 23 01:28:24 PST 2006
Von: Alexander Larsson <alexl at redhat.com>
> On Thu, 2006-11-23 at 09:49 +0100, Christian Ehrlicher wrote:
> > Hello,
> >
> > During our work on the win32 port, we found a problem with
> > dbus_fake_mutex_foo() - functions. Because they're only fake
> > functions, it is possible that one thread looks something and another
> > thread wants to access the locked variable. Instead waiting for
> > unlock, the thread throws an assert().
> > Now I wonder why you added those fake mutexes. You should get the same
> > problems on linux too (not that often because we use more locks)...
>
> You can't use the fake mutexes with actual threads. If you use threads
> you *have* to initialize dbus with thread support.
>
> The fake mutexes are there to use in tests to detect bugs like
> deadlocks.
>
But wouldn't it be better to use another ifdef than DBUS_BUILD_TESTS to enable the fake mutexes?
Christian
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
More information about the dbus
mailing list