why user defined function in thread will fail?



dear sirs:
    I use a user define function in g_thread on solaris in my gtk app, get a core dump crash. Why?  thanks.

in follow code, if I use do_blink in blink_thread_func, it crashed.
if I use printf instead of do_blink, it run ok.

void do_blink(int mode)
{
    printf("do_blink mode=%d\n",mode);
}

static gpointer blink_thread_func(gpointer data)
{
    int mode=0;
    while(1)
    {
        g_mutex_lock(blink_mutex);
/*        do_blink((mode++)/2); */
        printf("do_blink mode=%d\n",mode);
        g_usleep(G_USEC_PER_SEC);
        g_mutex_unlock(blink_mutex);
    }
}


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