Commented out testthreads from the build process, since we won't have any
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com> * gtk/Makefile.am: Commented out testthreads from the build process, since we won't have any idea how to create a thread. * configure.in (LIBS): use glib-config ... gthread so we always build a thread-compatible library. * gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c: Add GTK_THREADS_ENTER/LEAVE pairs around timeouts and idles to account for the fact that they are no longer called within the GTK+ lock. * gtk/gtkprivate.h: Added definitions for locking the main GTK+ mutex. * gtk/gtkmain.c: Re-implement the main loop in terms of the GLib main loop. * gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading functionality, as it seems better to subsume GDK within the GTK+ lock than vice-versa. * gdk/gdkevents.c: New file, containing event handling bits from gdk.c. * gdk/gdkevents.c: Implement event source for GDK events. * configure.in gdk/gdkevents.c: Removed attempts to subtract base_id, which were already non-functional.
This commit is contained in:
@ -53,7 +53,7 @@ counter (void *data)
|
||||
GtkWidget *label;
|
||||
GtkWidget *button;
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_threads_enter();
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), name);
|
||||
@ -83,7 +83,7 @@ counter (void *data)
|
||||
{
|
||||
sprintf(buffer, "%d", counter);
|
||||
gtk_label_set (GTK_LABEL (label), buffer);
|
||||
gdk_threads_leave();
|
||||
gtk_threads_leave();
|
||||
counter++;
|
||||
/* Give someone else a chance to get the lock next time.
|
||||
* Only necessary because we don't do anything else while
|
||||
@ -91,7 +91,7 @@ counter (void *data)
|
||||
*/
|
||||
sleep(0);
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_threads_enter();
|
||||
}
|
||||
|
||||
gtk_widget_destroy (window);
|
||||
@ -102,7 +102,7 @@ counter (void *data)
|
||||
gtk_main_quit();
|
||||
pthread_mutex_unlock (&nthreads_mutex);
|
||||
|
||||
gdk_threads_leave();
|
||||
gtk_threads_leave();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -115,7 +115,7 @@ main (int argc, char **argv)
|
||||
#ifdef USE_PTHREADS
|
||||
int i;
|
||||
|
||||
if (!gdk_threads_init())
|
||||
if (!gtk_threads_init())
|
||||
{
|
||||
fprintf(stderr, "Could not initialize threads\n");
|
||||
exit(1);
|
||||
@ -141,9 +141,9 @@ main (int argc, char **argv)
|
||||
|
||||
pthread_mutex_unlock (&nthreads_mutex);
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_threads_enter();
|
||||
gtk_main();
|
||||
gdk_threads_leave();
|
||||
gtk_threads_leave();
|
||||
fprintf(stderr, "Done\n");
|
||||
#else /* !USE_PTHREADS */
|
||||
fprintf (stderr, "GTK+ not compiled with threads support\n");
|
||||
|
||||
Reference in New Issue
Block a user