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



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

Attachment: signature.asc
Description: This is a digitally signed message part



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