Hi,

In message "sleep is broken with --enable-pthread [Was: Bad interaction between timeout.rb and --enable-pthread]"
    on 04/01/01, Nathaniel Talbott <nathaniel / talbott.ws> writes:
|So the problem is much more fundamental: sleep seems to not work at all 
|once a Ruby thread has been run if --enable-pthread is used. Any ideas?

Nathaniel, can you try this?

							matz.

diff -p -u -1 -r1.215 configure.in
--- configure.in	27 Dec 2003 14:42:41 -0000	1.215
+++ configure.in	1 Jan 2004 16:17:11 -0000
@@ -709,3 +709,3 @@ if test x"$enable_pthread" = xyes; then
     fi
-    AC_CHECK_FUNC(nanosleep)
+    AC_CHECK_FUNCS(nanosleep)
     if test x"$ac_cv_func_nanosleep" = xno; then
--- eval.c	30 Dec 2003 16:36:05 -0000	1.622
+++ eval.c	1 Jan 2004 16:17:46 -0000
@@ -10315,3 +10315,4 @@ rb_thread_wait_for(time)
 	int n;
-#ifndef linux
+	int thr_critical = rb_thread_critical;
+#ifdef linux
 	double d, limit;
@@ -10320,4 +10321,6 @@ rb_thread_wait_for(time)
 	for (;;) {
+	    rb_thread_critical = Qtrue;
 	    TRAP_BEG;
 	    n = select(0, 0, 0, 0, &time);
+	    rb_thread_critical = thr_critical;
 	    TRAP_END;