Re: Another thread/idle/timeout question



Perhaps the easiest thing is just to have the new thread set a flag (which the main iteration has access to) 
and then have the timeout and idle functions check the flag and return FALSE is it is set or return TRUE if 
not set.  


I still think signals would be more elegant, but maybe this is the easiest solution.



________________________________
 From: David Buchan <pdbuchan yahoo com>
To: gtk-app-devel-list list <gtk-app-devel-list gnome org> 
Sent: Thursday, July 5, 2012 9:26 AM
Subject: Another thread/idle/timeout question
 
Is there a way to have a (non-main iteration) thread issue a signal when it ends?

I start up a timeout and an idle function when I spawn a new thread.
I want the main iteration to stop the timeout and idle function as soon as the new thread is finished and 
disappears.

It seems to me that if that new thread would issue a signal upon ending, I could have a main iteration 
callback do the g_source_remove (idle function) and g_source_remove (timeout function). My understanding 
(wrong?) is that only the main iteration is allowed to call gtk functions like g_source_remove().


Or is there a smarter way to go?

Dave
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


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