Changing threading semantics from init early to init before second thread

Alexander Larsson alexl at redhat.com
Mon Aug 28 02:07:53 PDT 2006


On Fri, 2006-08-25 at 15:15 +0200, Alexander Larsson wrote:
> On Thu, 2006-08-24 at 14:47 -0400, Havoc Pennington wrote:
> 
> > Not suggesting that at all - dbus_threads_disable() would have to be 
> > called before you used any thread functions, and would then make those 
> > functions no-op instead of implicitly initializing the built-in thread 
> > abstraction. So e.g. dbus-daemon would call this at the start of main().
> 
> Here is an implementation of this. I didn't actually build the win32
> side this time, but it didn't really change, so i expect it to work.

I saw another interesting approach in libgamin. They use ELF magic (weak
symbols) to avoid linking to libpthreads, and then only use threads if
the app that pulled in libgamin linked to libpthreads.

We could use the same approach when selecting the default thread
implementation.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a superhumanly strong white trash paranormal investigator with no name. 
She's a bloodthirsty gypsy hooker from Mars. They fight crime! 



More information about the dbus mailing list