Re: (no subject)



There is something I don't understand here:

> void
> on_start_clicked                       (GtkButton       *button,
>                                         gpointer         user_data)
> {
>     if (pthread_create(&THR, NULL, (void *) &work, NULL) != 0){
>         printf("Can't create thread\n");
>         exit(-1);
>     }
> 
>     work(NULL);
> }
> 


I appears to me that you are both starting a thread to do "work", and
you are calling "work" directly from your on_start_clicked callback
function.  

In other words, it looks like even if you removed the if(pthr..) test
and action, the click of start would cause work() to be done, and the
app to be unresponsive until it had finished.

This is not meant to imply that the other response I saw to your
question is not right, but you may have two problems.

Or, I may be missing something obvious....


Eric




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