diff --git a/ChangeLog b/ChangeLog index f8b329204..61d55cae0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1997-11-27 Mikael Djurfeldt + + * configure.in: Added code to enable GUILE_ISELECT on systems + which have the necessary functions (gettimeofday, select). + + * acconfig.h: Added GUILE_ISELECT. + 1997-11-24 Tim Pierce * acinclude.m4: Assume dlsym does not add underscore if diff --git a/NEWS b/NEWS index 22fd7b380..56eaed3ba 100644 --- a/NEWS +++ b/NEWS @@ -375,6 +375,19 @@ missing. * Changes to the scm_ interface +** Function: int scm_internal_select (int fds, + SELECT_TYPE *rfds, + SELECT_TYPE *wfds, + SELECT_TYPE *efds, + struct timeval *timeout); + +This is a replacement for the `select' function provided by the OS. +It enables I/O blocking and sleeping to happen for one cooperative +thread without blocking other threads. It also avoids busy-loops in +these situations. It is intended that all I/O blocking and sleeping +will finally go through this function. Currently, this function is +only available on systems providing `gettimeofday' and `select'. + ** Function: SCM scm_internal_stack_catch (SCM tag, scm_catch_body_t body, void *body_data, diff --git a/acconfig.h b/acconfig.h index 01b4a6f96..64733e499 100644 --- a/acconfig.h +++ b/acconfig.h @@ -51,6 +51,9 @@ the Guile library itself. */ #undef GUILE_DEBUG +/* Define to implement scm_internal_select */ +#undef GUILE_ISELECT + /* Define if using cooperative multithreading. */ #undef USE_COOP_THREADS diff --git a/configure.in b/configure.in index 813afe005..bae586554 100644 --- a/configure.in +++ b/configure.in @@ -92,7 +92,7 @@ fi GUILE_DLSYM_USCORE -AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gethostent gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid) +AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gethostent gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid bzero) dnl @@ -320,6 +320,19 @@ if test "$cy_cv_threads_package" != ""; then LIBOBJS="$LIBOBJS threads.o" fi +#-------------------------------------------------------------------- +# +# scm_internal_select +# +#-------------------------------------------------------------------- + +if test "$cy_cv_threads_package" != "" && + test $ac_cv_func_gettimeofday = yes && + test $ac_cv_func_select = yes; then + AC_DEFINE(GUILE_ISELECT, 1) + LIBOBJS="$LIBOBJS iselect.o" +fi + ## If we're using GCC, ask for aggressive warnings. case "$GCC" in yes ) CFLAGS="$CFLAGS -Wall -Wpointer-arith" ;;