Gtk thread inside application.



Hello,

I have an application into which I have compiled a GTK based tool that runs
as a pthread inside the application. So far executing the GTK thread after
the application starts is not a problem. Unfortunately when trying to
terminate the GTK thread the GUI seems hangs and the GTK window does not
close eventhough its thread has terminated.

I'm using the following code to terminate the GTK thread from inside my
application:


      gtk_main_quit();
      errcode = pthread_cancel(GTK_thread);
      if((errcode=pthread_join(GTK_thread, NULL)))
      {
         fprintf( stderr,"pthread_join Error => %s\n", strerror(errcode));
      }
      else
      {
         // End GUI
         GTK_RUNNING = FALSE;
      }

where GTK_thread is the result from pthread_create executed earlier.

If anyone has any pointer it will be greatly appreciated.

Thanks.




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