Re: [patch] some threading fixes, and handle no default printers

Owen Taylor <[email protected]> Mon, 16 Aug 2004 11:04:19 -0400
Newsgroups gmane.comp.gnome.print
Message-ID <[email protected]>
On Fri, 2004-08-13 at 15:18, Jody Goldberg wrote:
> On Tue, Aug 03, 2004 at 01:37:41PM -0400, Colin Walters wrote:
> > Hi,
> > 
> > Attached is a patch to libgnomeprintui which adds some
> > GDK_THREADS_ENTER
> > calls to callbacks eventually run from the libgnomecups idle
> > handlers.  
> 
> Putting the threading checks in the gpaui code where there are no
> obvious threads is certainly simple, but seems out of place.  I'd
> rather they be down in the only threaded backend
>     libgnomeprint/libgnomeprint/modules/cups/gnome-print-cups.c
> which keeps knowledge of threads local.

Without looking at the particular code, the general rule for *any*
library that uses GTK+ is that if you have an idle handler
or a timeout in which you are going to do GTK+ stuff, you need
a gdk_threads_enter()/gdk_threads_leave() pair around it.

This is the only way that your library will be usable from a 
program that does gdk_threads_init().

Regards,
						Owen

_______________________________________________
gnome-print-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-print-list
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBBIMzzS+2LB0B90LERAkZpAKCBHyyq8AbLToXbB5/+EU0T6VMXiQCfR0p9
OhcXmhuNcxOiwmV6jzSwniY=
=S0qk
-----END PGP SIGNATURE-----