1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-12-24 19:38:15 +00:00
parent 060f19e92c
commit cecdab3bf0
3 changed files with 26 additions and 4 deletions

View file

@ -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

View file

@ -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

11
eval.c
View file

@ -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;
{
for (;;) {
#ifdef HAVE_NANOSLEEP
struct timespec req, rem;
for (;;) {
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) {