Gtk/GLib timeouts and pthreads
- From: Felipe Paulo Guazzi Bergo <guazzibe dcc unicamp br>
- To: gtk-list <gtk-list redhat com>
- Subject: Gtk/GLib timeouts and pthreads
- Date: Fri, 19 Nov 1999 15:58:09 -0200 (EDT)
I've come into some trouble using timeouts and threads together in a GTK+
I need to perform some blocking network operations and want a graphics
spinner while the connection is being set up.
My code goes like this:
[from an early time there are one or two timeouts active]
pthread_create(..); // open a thread that will do the network stuff
// and pthread_exit when done, and also clear a
// a variable so that that main thread knows it
And now I should be happy, but all timeouts (created with gtk_timeout_add)
in my app (which were set up before this piece of code) stop
working (calling the callback).
If I gtk_timeout_remove them before this piece code and add them again, it
seems that the old timeouts are not removed (I get intervals too small).
Before this piece of code were added the timeouts were working fine.
The thread spawned doesn't do _anything_ with glib/gdk/gtk.
Can anyone shed some light here ?
] [Thread Prev