Re: Idle Function Not Getting Called



On Mon, 14 Sep 2009 13:24:30 -0400 (EDT)
Marshall Lake <mlake mlake net> wrote:

I'm using only Linux.

I assume you have made the main loop thread-safe by calling 
g_thread_init()?

The following are the first few lines of my main() ...

     openlog ("gtknsbclient", LOG_NDELAY, LOG_USER);
     if (!g_thread_supported ())
         g_thread_init (NULL);
     gdk_threads_init ();
     gdk_threads_enter ();

     /* initialize GTK interface */
     gtk_init (&argc, &argv);


And now you pull the GDK global lock out of the hat to add to the mix!

I would suspect that you are recursively, or out-of-order, locking on
that, given the large number of other locks you seem to have in your
program. It is difficult to use correctly.  

Why incidentally are you using both extra-threaded access to GTK+ with
the GDK global lock and also accessing GTK+ from threads via the idle
handler?  You would normally do one or the other, not both.  Why not
drop the global lock, or drop the idle handlers (preferably the first
of those)?

Chris





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