Re: Work woth GUI from a thread that was made by pthread_create function
- From: Michael Meeks <michael ximian com>
- To: Pawel Salek <pawsa theochem kth se>
- Cc: admin kiesoft com, Gtk Hackers <gtk-devel-list gnome org>, gtk-app-devel-list gnome org, gnome-devel-list gnome org
- Subject: Re: Work woth GUI from a thread that was made by pthread_create function
- Date: 11 Feb 2002 11:11:31 +0000
Hi Pawel,
On Thu, 2002-02-07 at 20:36, Pawel Salek wrote:
> You need to lock gdk mutex before entering the main loop.
>
> gdk_threads_enter();
> gtk_main();
> gdk_threads_leave();
You also need to drop locks before doing things eg.
gdk_threads_leave ();
do_some_gtk_call ();
gdk_threads_enter ();
eg. in signal handlers, and such like - but it very much depends if the
signal is emitted from the Gtk mainloop, or explicitly from another
source, if from another source then depending on whether you're in a
mainloop you need to lock,unlock or unlock,lock in a not altogether
clear fashion.
In short I'd avoid threads & Gtk+ like the plague.
Hmm,
Michael.
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]