Re: thread support in Windows: problem
- From: Chris Vine <chris cvine freeserve co uk>
- To: "fkater googlemail com" <fkater googlemail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: thread support in Windows: problem
- Date: Thu, 24 Jan 2008 21:47:21 +0000
On Thu, 2008-01-24 at 21:26 +0100, fkater googlemail com wrote:
I've tried to make gtk work with threads on win32 and linux for a long
time now and I am finally proud to say, it is possible -- but, as Tor
said, not trivial.
[snip]
Write wrapper functions for any gtk operation you'd like to execute from
threads in a way that the thread calls a glib's idle function which does
the real gtk work. Additionally (!) you need to lock gtk/gdk access by
the gds_threads_enter/leave functions -- since idle functions are not
auto-locked by gtk (like signals are).
It's pointless calling gdk_threads_enter()/leave() in windows because it
won't work. It's also unnecessary in your use because the callback for
g_idle_add() executes in the GTK+ main loop and not in the calling
thread - which is fine, and works well.
So your approach is correct, except as regards the need to call
gdk_threads_enter()/leave().
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]