Re: Gtk thread inside application.



On Tue, 8 Oct 2002 14:58:59 -0400
mquezada nlxcorp com wrote:

gtk_main_quit();

Why are you calling gtk_main_quit() from this thread? Shouldn't be
called from the GTK_thread?

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.

I am not sure that you mean by "...is the result from...". If
GTK_thread is the return value of pthread_create, then this will not
work, as the return value is not the new pid.

-- Mitko


The gtk_main_quit call was a mistake, my paste button failed. It is
actually inside the "destroy" callback.

This is the way the thread is created:

      if((errcode=pthread_create(&GTK_thread,
                                  NULL,
                                  GTK_GUI_THREAD,
                                  ARGV)))
      {
         fprintf( stderr,"pthread_create Error => %s\n",
strerror(errcode));
      }

I'm not sure why the GUI stays on until the manager thread is closed and
doesn't end when the pthread_cancel and pthread_join calls are made.




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