зеркало из https://github.com/github/ruby.git
* eval.c (rb_with_disable_interrupt): prohibit thread context
switch during proc execution. [ruby-dev:21899] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
bb4f36de3a
Коммит
e91e9e7bbf
|
@ -25,6 +25,11 @@ Sat Dec 20 11:40:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||
|
||||
* lib/yaml.rb (YAML::YAML): adjust Marshal version.
|
||||
|
||||
Sat Dec 20 03:56:02 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (rb_with_disable_interrupt): prohibit thread context
|
||||
switch during proc execution. [ruby-dev:21899]
|
||||
|
||||
Sat Dec 20 02:41:02 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* lib/webrick/cgi.rb: add file. (yet another CGI library)
|
||||
|
|
|
@ -379,7 +379,7 @@ AC_FUNC_FSEEKO
|
|||
AC_CHECK_FUNCS(ftello)
|
||||
AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
|
||||
strchr strstr strtoul crypt flock vsnprintf\
|
||||
isinf isnan finite hypot acosh erf)
|
||||
isnan finite isinf hypot acosh erf)
|
||||
AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd\
|
||||
truncate chsize times utimes fcntl lockf lstat symlink readlink\
|
||||
setitimer setruid seteuid setreuid setresuid setproctitle\
|
||||
|
|
2
dln.c
2
dln.c
|
@ -91,7 +91,7 @@ char *getenv();
|
|||
|
||||
int eaccess();
|
||||
|
||||
#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__)
|
||||
+#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) && !defined(_UNICOSMP)
|
||||
/* dynamic load with dlopen() */
|
||||
# define USE_DLN_DLOPEN
|
||||
#endif
|
||||
|
|
12
eval.c
12
eval.c
|
@ -4739,11 +4739,13 @@ rb_with_disable_interrupt(proc, data)
|
|||
int status;
|
||||
|
||||
DEFER_INTS;
|
||||
PUSH_TAG(PROT_NONE);
|
||||
if ((status = EXEC_TAG()) == 0) {
|
||||
result = (*proc)(data);
|
||||
}
|
||||
POP_TAG();
|
||||
RUBY_CRITICAL(
|
||||
PUSH_TAG(PROT_NONE);
|
||||
if ((status = EXEC_TAG()) == 0) {
|
||||
result = (*proc)(data);
|
||||
}
|
||||
POP_TAG();
|
||||
);
|
||||
ALLOW_INTS;
|
||||
if (status) JUMP_TAG(status);
|
||||
|
||||
|
|
|
@ -800,7 +800,7 @@ ip_ruby(clientData, interp, argc, argv)
|
|||
{
|
||||
VALUE res;
|
||||
int old_trapflag;
|
||||
struct eval_body_arg arg;
|
||||
struct eval_body_arg arg;
|
||||
int dummy;
|
||||
|
||||
/* ruby command has 1 arg. */
|
||||
|
@ -817,7 +817,7 @@ ip_ruby(clientData, interp, argc, argv)
|
|||
arg.failed = 0;
|
||||
|
||||
/* evaluate the argument string by ruby */
|
||||
DUMP2("rb_eval_string(%s)", arg);
|
||||
DUMP2("rb_eval_string(%s)", arg.string);
|
||||
old_trapflag = rb_trap_immediate;
|
||||
res = rb_ensure(ip_ruby_eval_body, (VALUE)&arg,
|
||||
ip_ruby_eval_ensure, INT2FIX(old_trapflag));
|
||||
|
@ -1775,7 +1775,7 @@ eval_queue_handler(evPtr, flags)
|
|||
{
|
||||
struct eval_queue *q = (struct eval_queue *)evPtr;
|
||||
|
||||
DUMP2("do_eval_queue_handler : evPtr = %lx", evPtr);
|
||||
DUMP2("do_eval_queue_handler : evPtr = %p", evPtr);
|
||||
DUMP2("eval queue_thread : %lx", rb_thread_current());
|
||||
DUMP2("added by thread : %lx", q->thread);
|
||||
|
||||
|
@ -2176,7 +2176,7 @@ invoke_queue_handler(evPtr, flags)
|
|||
{
|
||||
struct invoke_queue *q = (struct invoke_queue *)evPtr;
|
||||
|
||||
DUMP2("do_invoke_queue_handler : evPtr = %lx", evPtr);
|
||||
DUMP2("do_invoke_queue_handler : evPtr = %p", evPtr);
|
||||
DUMP2("invoke queue_thread : %lx", rb_thread_current());
|
||||
DUMP2("added by thread : %lx", q->thread);
|
||||
|
||||
|
|
|
@ -9,16 +9,33 @@ int
|
|||
isinf(n)
|
||||
double n;
|
||||
{
|
||||
if (IsNANorINF(n) && IsINF(n)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
if (IsNANorINF(n) && IsINF(n)) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
isinf(n)
|
||||
double n;
|
||||
{
|
||||
return (!finite(x) && !isnan(x))
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
|
@ -44,3 +61,4 @@ isinf(n)
|
|||
|| memcmp(&n, &ninf, sizeof n) == 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,31 +1,17 @@
|
|||
/* public domain rewrite of isnan(3) */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include <float.h>
|
||||
int
|
||||
isnan(n)
|
||||
double n;
|
||||
{
|
||||
return _isnan(n);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int double_ne();
|
||||
|
||||
int
|
||||
isnan(n)
|
||||
double n;
|
||||
double n;
|
||||
{
|
||||
return double_ne(n, n);
|
||||
return double_ne(n, n);
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
static int
|
||||
double_ne(n1, n2)
|
||||
double n1, n2;
|
||||
double n1, n2;
|
||||
{
|
||||
return n1 != n2;
|
||||
return n1 != n2;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
#include <floatingpoint.h>
|
||||
#endif
|
||||
|
||||
#ifdef _UNICOSMP
|
||||
#include <intrinsics.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FLOAT_H
|
||||
#include <float.h>
|
||||
#endif
|
||||
|
@ -1828,6 +1832,9 @@ Init_Numeric()
|
|||
#if defined(__FreeBSD__) && __FreeBSD__ < 4
|
||||
/* allow divide by zero -- Inf */
|
||||
fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV|FP_X_OFL));
|
||||
#elif defined(_UNICOSMP)
|
||||
/* Turn off floating point exceptions for divide by zero, etc. */
|
||||
_set_Creg(0, 0);
|
||||
#endif
|
||||
id_coerce = rb_intern("coerce");
|
||||
id_to_i = rb_intern("to_i");
|
||||
|
|
Загрузка…
Ссылка в новой задаче