Re: problems when using g_main_loop_quit from different thread
- From: Tristan Van Berkom <tristan van berkom gmail com>
- To: Tristan Van Berkom <tvb gnome org>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: problems when using g_main_loop_quit from different thread
- Date: Thu, 09 Mar 2006 12:55:41 -0500
Tristan Van Berkom wrote:
My guess is that it just doent make sence to remove the mainloop
while the other thread is sleeping in poll(), sure the code will lock
its mutex and everything; but when the other thread wakes up;
how could it deal with a "gone mainloop" ?
Scratch that; doesnt make any sence; the code also seems to have
thread conditional stuff; so it should work - I guess.
... Maybe it fails in the off chance that its not in poll() ? still
should work ...
Solution ? I would use an idle function to the thread's loop; using
the GSource lower level apis (i.e. create the idle source and do
g_source_attach to the thread's context); and just quit from
there.
I still bet this will work (unless you are running a rare gtk binary
that was compiled without thread support; and that should have
been indicated when you called g_thread_supported()).
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]