Re: Stupid question regarding g_thread_init() and gtk_threads_init()



> Hi,
>
> "NavEcos" <ecos navosha com> writes:
>
> > Or why doesn't, say, gdk_threads_enter() say with an ASSERT "hey
> > stupid: I noticed that g_thread_init() was never called".
>
> But that's exactly what the code does:
>
> void
> gdk_threads_init ()
> {
>   if (!g_thread_supported ())
>     g_error ("g_thread_init() must be called before gdk_threads_init()");

Told you I was stupid.

But if you remember, my original message included the fact that I've only
been using g_thread_init() in my previous code in GTK 1.3(?) and I have
never had an XSync error doing that.  My question was, has that always been
a bug?  Why didn't my previous code ever crash?  I've only had problems
since I upgraded to 2.x

> > I don't want to sound like a little brat here since I really like
> > GTK and I really appreciate that it's available to me, but I think a
> > couple slight modifications would go a long way into making GTK a
> > lot easier to use.  GtkInitForStupidPeople (bool bEnableThreads) or
> > something, where it does everything for you - as a convenience
> > function would be great.  I know you can use different contexts and
> > stuff like that, but the reality is that only a handful of people
> > do.  Why not make a "duh" interface?  Let's face it, I'm just
> > totally stupid, and being very dumb, I like simple interfaces.
> > Simple interfaces prevent dumb people like me from filling up lists
> > with stupid questions like this, and it reduces bugs too.
>
> That says it all.

I don't deny it.  I'm just saying that it's not very intuitive.

If previous libraries (IF) didn't require the use of gtk_thread_init() it's
pretty bad form, since linking to the new library causes a bug.

> Sven
>




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