Re: gtk_main_quit from another thread
- From: Tristan Van Berkom <tristan van berkom gmail com>
- To: Zeeshan Ali <zeenix gmail com>
- Cc: Gtk Mailing List <gtk-app-devel-list gnome org>
- Subject: Re: gtk_main_quit from another thread
- Date: Mon, 14 Feb 2005 10:48:14 -0500
On Sat, 12 Feb 2005 15:57:59 +0500, Zeeshan Ali <zeenix gmail com> wrote:
Hello,
What is the correct/nice way of asking a thread to stop from the
main thread if that thread is in a gtk_main (). I simply call
gtk_main_quit () from my main thread and then wait for that thread to
actually finish calling g_thread_join (). I've a hunch that there is
something wrong with this technique. Am i right? Thanks in advance.
Bye.
If you need to transfer alot of different requests etc, you can implement
an IPC for your threads using a GAsyncQueue (or something else),
otherwise you could just use a global variable (possibly protected by
a mutex) to notify your child thread that it should exit.
So generaly you would start by requesting termination of your child thread
and then g_thread_join() (you might also `kill()' your child thread if
it doesn't
exit in time).
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]