Re: Idle Function Not Getting Called

I've taken some time to check the mutex and locks/unlocks between the secondary thread and the idle function. All appear as it should. The locks/unlocks are being applied in an orderly fashion and as they should be, and there are no recursive locks. The program flows as it should.

I still feel my problem has something to do with the secondary thread and idle function working together but at this point I'm not sure what to check next.

I am only familiar with glib on unix-like systems, where GMutex/GThread/ GCond are thin wrappers for their pthread counterparts. g_idle_add() is implemented differently in windows as well, with a windows event object rather than a unix pipe.

If you are using windows, possibly the contortions necessary to fit windows threads into a pthread-type model is causing the difficulty.

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);

Marshall Lake -- mlake mlake net --

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