Re: GIO will link with -pthread soon



> We really need to get our story together here. Either we do our very
> best to handle late g_thread_init(), or we should fail spectactularly.

Agree 100%.

My own humble opinion is that even GLib (not just GIO) should link to
-lpthread and work as if g_thread_init(NULL) would have been
implicitly called before any other GLib calls.
g_threads_got_initialized would be TRUE always. But I certainly admit
I don't understand all the implications of this, and implementation
details it would require, especially on Linux. (On Windows, ~all code
compiled by modern C compilers, certainly including the GTK+ stack,
use a multi-thread-aware C library always anyway, which corresponds
more or less to linking with -lpthread on Linux, I think.)

> I guess orbit needing this is the main reason why we can't just make it fail?

I attempted last year to make ORBit2 *not* call g_thread_init()
itself, "as it is usually too late", but had to revert it. See bug
#547885 .

--tml


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