Threads



Hi,
In the faq on threads (http://www.gtk.org/faq/#AEN482), there is:

int
main (int argc, char *argv[])
{
  GtkWidget *window;

  /* init threads */    
  g_thread_init(NULL);
  gdk_threads_init();

  /* init gtk */
  gtk_init(&argc, &argv);

  window = create_window();
  gtk_widget_show(window);

  gdk_threads_enter();
  gtk_main();
  gdk_threads_leave();

  return 0;
}

Because gdk_threads_enter()/leave() surround gtk_main(), then
wouldn't that mean other threads that use gdk_threads_enter()/leave()
are always blocked until gtk_main() exits?



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