Basic thread-awareness:
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org> Basic thread-awareness: * acconfig.h configure.in: New option --with-threads=[yes/posix/no] * gdk/Makefile.am gdk/gdkthreads.c: Added new functions gdk_threads_[init/enter/leave] for applications, plus gdk_threads_wake to wake the mainloop thread out of the select(). * gtk/Makefile.am: gtk/testthreads.c: Test program for threads Fri May 15 12:08:48 1998 Owen Taylor <otaylor@gtk.org> * gtk/testgtk.c (list_clear): Account for the fact that gtk_list_clear_items is not inclusive. (Clears [start, end))
This commit is contained in:
@ -1606,8 +1606,31 @@ gdk_event_wait (void)
|
||||
max_input = MAX (max_input, input->source);
|
||||
}
|
||||
|
||||
#ifdef USE_PTHREADS
|
||||
if (gdk_using_threads)
|
||||
{
|
||||
gdk_select_waiting = TRUE;
|
||||
|
||||
FD_SET (gdk_threads_pipe[0], &readfds);
|
||||
max_input = MAX (max_input, gdk_threads_pipe[0]);
|
||||
gdk_threads_leave ();
|
||||
}
|
||||
#endif
|
||||
|
||||
nfd = select (max_input+1, &readfds, &writefds, &exceptfds, timerp);
|
||||
|
||||
#ifdef USE_PTHREADS
|
||||
if (gdk_using_threads)
|
||||
{
|
||||
gchar c;
|
||||
gdk_threads_enter ();
|
||||
gdk_select_waiting = FALSE;
|
||||
|
||||
if (FD_ISSET (gdk_threads_pipe[0], &readfds))
|
||||
read (gdk_threads_pipe[0], &c, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
timerp = NULL;
|
||||
timer_val = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user