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



On Tue, 2004-07-27 at 05:06, NavEcos wrote:
> Why are there two functions for this?  Why doesn't g_thread_init() call
> gtk_threads_init()?

The equivalent of gdk_threads_init() used to be done at gtk_init()
time if g_thread_init() had been called, but it turned out that many
applications wanted to use GLib threaded, but only use GTK+ from a
single thread. 

Once gdk_threads_init() has been called, you have to follow additional
rules for locking in your application so it isn't something you want on 
if you aren't using GTK+ from multiple threads.

> Has this ALWAYS been the case the g_thread_init() has to be followed by
> gtk_threads_init() because if so, I have a very long standing bug, that's
> been in my code for years.

Well, depends on how long your code has been around. The switch
was made prior to GTK+-2.0, it's mentioned in:

 http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html

Regards,
						Owen

Attachment: signature.asc
Description: This is a digitally signed message part



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