summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--configure.in4
-rw-r--r--eval.c13
3 files changed, 26 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7aadcec001..ca22d797b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,18 @@
-Thu Dec 25 00:17:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Thu Dec 25 04:00:44 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* stable version 1.8.1 released.
+Thu Dec 25 00:17:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * configure.in: check for nanosleep, -lrt if required.
+ [ruby-core:02059]
+
+ * eval.c (thread_timer): use select(2) if nanosleep(2) is not
+ available.
+
+ * eval.c: check __stub_getcontext for glibc on some platforms.
+ [ruby-list:38984]
+
Wed Dec 24 23:48:04 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/soap/test_basetype.rb, test/soap/marshal/test_marshal.rb
diff --git a/configure.in b/configure.in
index bab27ad065..456f653c9e 100644
--- a/configure.in
+++ b/configure.in
@@ -721,6 +721,10 @@ if test "$enable_pthread" = "yes"; then
fi
fi
fi
+ AC_CHECK_FUNC(nanosleep)
+ if test "$ac_cv_func_nanosleep" = "no"; then
+ AC_CHECK_LIB(rt, nanosleep, AC_DEFINE(HAVE_NANOSLEEP))
+ fi
fi
dnl default value for $KANJI
diff --git a/eval.c b/eval.c
index 9a6d342e43..839c0c0dd3 100644
--- a/eval.c
+++ b/eval.c
@@ -29,7 +29,7 @@
#endif
#include <stdio.h>
-#if defined(HAVE_UCONTEXT_H) && (defined(__ia64__) || defined(HAVE_NATIVETHREAD))
+#if defined(HAVE_UCONTEXT_H) && (defined(__ia64__) || defined(HAVE_NATIVETHREAD)) && !defined(__stub_getcontext)
#include <ucontext.h>
#define USE_CONTEXT
#else
@@ -9552,12 +9552,19 @@ static void*
thread_timer(dummy)
void *dummy;
{
- struct timespec req, rem;
-
for (;;) {
+#ifdef HAVE_NANOSLEEP
+ struct timespec req, rem;
+
req.tv_sec = 0;
req.tv_nsec = 10000000;
nanosleep(&req, &rem);
+#else
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 10000;
+ select(0, NULL, NULL, NULL, &tv);
+#endif
if (!rb_thread_critical) {
rb_thread_pending = 1;
if (rb_trap_immediate) {