Re: Xlib unexpected async



Paul Davis <pbd Op Net> writes:

> >I read the mailing list, and yes, there is a g_thread_init(0) in the
> >main function, as well as
> >
> >gdk_threads_enter();
> >gtk_main();
> >gdk_threads_leave();
> 
> why are you calling the thread functions at this level? they guarantee
> that no other thread will ever be able to enter GTK, since the mutex
> they operate on will be held for the entire duration of the GUI's
> existence. 

GTK+ releases the lock during gtk_main(). In fact, the
gdk_threads_enter/leave pair here is required.

The cause of the errors is definitely that some GDK or X function is
being called outside of a gdk_thread_enter/leave pair.

(If you add just an enter and not a leave, then yes, your program
will hang next time the drawing code is hit.) 

Regards,
                                        Owen




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