Re: Crossing thread boundary with idle function
- From: Philip Boulain <prb ecs soton ac uk>
- To: Chris Vine <chris cvine freeserve co uk>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Crossing thread boundary with idle function
- Date: Wed, 13 Dec 2006 21:52:06 +0000
On Wed, 2006-12-13 at 21:20 +0000, Chris Vine wrote:
On Wednesday 13 December 2006 18:05, Philip Boulain wrote:
When GTK+ is in its main run loop, blocking on an event, is there a way
to awaken/unblock it from some external thread such that it will pay
attention to newly-added idle functions?
I does that by itself. You have probably not called g_thread_init() (or
Glib::thread_init()).
Ah, I wondered if it was supposed to.
I haven't, no; my understanding of those is that they will enable the
Glib-specific threading system. I was kind of concerned about how that
would interact with the fact that we're already using pthreads (various
comic historic reasons).
I have now added it, and that appears to work, at least for the Linux
build. (If it breaks for Windows, I get to see how much teeth-gnashing
can come from having to port a load of pthreads-based code over to Glib
threads can cause. ;) )
(For the sake of catching stupid newbie errors which may later bite me
in the posterior: the thread_init() directly precedes the Gtk::Main()
construction, within the UI thread; from what I can tell, this is the
correct approach.)
Thanks again,
Phil
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]