GIO will link with -pthread soon



Hi

Since there has been so much love on the list lately for linking GIO to
some extra libs, I want to do one more.

I have it on good authority[1] that it's a no-no to dlopen() libpthread
into an executable that is not, itself, linked against libpthread.  The
rationale for why this is bad is something akin to why it's bad to call
g_thread_init() after glib has been running for a while -- the libc has
been using unlocked data structures.

libdbus links against libpthread.  libgvfsdbus.so depends on libdbus and
GIO very often dlopen()s that.

On Linux with glibc it turns out that things more or less work out OK,
which is probably why nobody noticed this problem yet.  gdb, on the
other hand, becomes very unhappy.

You may have seen this:

Starting program: /home/desrt/test
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error
(gdb) 



The easiest fix here is to link libgio with -pthread.  We discussed this
at the GTK meeting yesterday and decided to do this unless anyone on the
list has a compelling reason not to.

Cheers


[1] danw



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]