Project

General

Profile

Backport #2739 » 0002-for-linux.patch

kosaki (Motohiro KOSAKI), 03/09/2010 02:28 AM

View differences:

eval.c
safe_mutex_lock(&time_thread.lock);
if (pthread_create(&time_thread.thread, 0, thread_timer, args) == 0) {
thread_init = 1;
#ifndef __NetBSD__
#if !defined(__NetBSD__) && !defined(linux)
pthread_atfork(0, 0, rb_thread_stop_timer);
#endif
pthread_cond_wait(&start, &time_thread.lock);
io.c
}
retry:
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(linux)
rb_thread_stop_timer();
#endif
switch ((pid = fork())) {
......
ruby_sourcefile, ruby_sourceline, pname);
_exit(127);
}
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(linux)
rb_thread_start_timer();
#endif
rb_io_synchronized(RFILE(orig_stdout)->fptr);
......
return Qnil;
case -1: /* fork failed */
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(linux)
rb_thread_start_timer();
#endif
if (errno == EAGAIN) {
......
break;
default: /* parent */
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(linux)
rb_thread_start_timer();
#endif
if (pid < 0) rb_sys_fail(pname);
process.c
fflush(stderr);
#endif
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(linux)
before_exec();
pid = fork();
after_exec();
......
chfunc = signal(SIGCHLD, SIG_DFL);
retry:
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(linux)
before_exec();
#endif
pid = fork();
......
rb_protect(proc_exec_args, (VALUE)&earg, NULL);
_exit(127);
}
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(linux)
after_exec();
#endif
if (pid < 0) {
(2-2/2)