mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
revert r65807
it didn't work. http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1468677 and skips broken tests for now. But this issue should be fixed soon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
797098f8e8
commit
27322735af
4 changed files with 8 additions and 16 deletions
|
|
@ -1633,12 +1633,10 @@ VALUE rb_math_sqrt(VALUE);
|
||||||
#if USE_MJIT
|
#if USE_MJIT
|
||||||
extern int mjit_enabled;
|
extern int mjit_enabled;
|
||||||
VALUE mjit_pause(int wait_p);
|
VALUE mjit_pause(int wait_p);
|
||||||
void mjit_pause_without_ints(void);
|
|
||||||
VALUE mjit_resume(void);
|
VALUE mjit_resume(void);
|
||||||
#else
|
#else
|
||||||
#define mjit_enabled 0
|
#define mjit_enabled 0
|
||||||
static inline VALUE mjit_pause(int wait_p){ return Qnil; } /* unreachable */
|
static inline VALUE mjit_pause(int wait_p){ return Qnil; } /* unreachable */
|
||||||
static inline void mjit_pause_without_ints(void){} /* unreachable */
|
|
||||||
static inline VALUE mjit_resume(void){ return Qnil; } /* unreachable */
|
static inline VALUE mjit_resume(void){ return Qnil; } /* unreachable */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
15
mjit.c
15
mjit.c
|
|
@ -677,7 +677,7 @@ mjit_init(struct mjit_options *opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stop_worker(int check_ints_p)
|
stop_worker(void)
|
||||||
{
|
{
|
||||||
rb_execution_context_t *ec = GET_EC();
|
rb_execution_context_t *ec = GET_EC();
|
||||||
|
|
||||||
|
|
@ -687,17 +687,10 @@ stop_worker(int check_ints_p)
|
||||||
stop_worker_p = TRUE; /* Setting this inside loop because RUBY_VM_CHECK_INTS may make this FALSE. */
|
stop_worker_p = TRUE; /* Setting this inside loop because RUBY_VM_CHECK_INTS may make this FALSE. */
|
||||||
rb_native_cond_broadcast(&mjit_worker_wakeup);
|
rb_native_cond_broadcast(&mjit_worker_wakeup);
|
||||||
CRITICAL_SECTION_FINISH(3, "in stop_worker");
|
CRITICAL_SECTION_FINISH(3, "in stop_worker");
|
||||||
if (check_ints_p) RUBY_VM_CHECK_INTS(ec);
|
RUBY_VM_CHECK_INTS(ec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A function to stop MJIT worker when it's not safe to allow interrupts. */
|
|
||||||
void
|
|
||||||
mjit_pause_without_ints(void)
|
|
||||||
{
|
|
||||||
stop_worker(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Stop JIT-compiling methods but compiled code is kept available. */
|
/* Stop JIT-compiling methods but compiled code is kept available. */
|
||||||
VALUE
|
VALUE
|
||||||
mjit_pause(int wait_p)
|
mjit_pause(int wait_p)
|
||||||
|
|
@ -723,7 +716,7 @@ mjit_pause(int wait_p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_worker(TRUE);
|
stop_worker();
|
||||||
return Qtrue;
|
return Qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -816,7 +809,7 @@ mjit_finish(void)
|
||||||
CRITICAL_SECTION_FINISH(3, "in mjit_finish to wakeup from pch");
|
CRITICAL_SECTION_FINISH(3, "in mjit_finish to wakeup from pch");
|
||||||
|
|
||||||
/* Stop worker */
|
/* Stop worker */
|
||||||
stop_worker(TRUE);
|
stop_worker();
|
||||||
|
|
||||||
rb_native_mutex_destroy(&mjit_engine_mutex);
|
rb_native_mutex_destroy(&mjit_engine_mutex);
|
||||||
rb_native_cond_destroy(&mjit_pch_wakeup);
|
rb_native_cond_destroy(&mjit_pch_wakeup);
|
||||||
|
|
|
||||||
|
|
@ -1506,9 +1506,8 @@ static void
|
||||||
before_fork_ruby(void)
|
before_fork_ruby(void)
|
||||||
{
|
{
|
||||||
if (mjit_enabled) {
|
if (mjit_enabled) {
|
||||||
/* Avoid leaving locked mutex and units being modified for child process. Here may not be
|
/* avoid leaving locked mutex and units being modified for child process. */
|
||||||
safe for proceeding SIGCHLD handler, so this does not allow RUBY_VM_CHECK_INTS. */
|
mjit_pause(FALSE);
|
||||||
mjit_pause_without_ints();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
before_exec();
|
before_exec();
|
||||||
|
|
|
||||||
|
|
@ -1724,6 +1724,7 @@ class TestProcess < Test::Unit::TestCase
|
||||||
|
|
||||||
if Process.respond_to?(:daemon)
|
if Process.respond_to?(:daemon)
|
||||||
def test_daemon_default
|
def test_daemon_default
|
||||||
|
skip 'Process.daemon in IO.popen block deadlocks with MJIT [Bug #15320]' if RubyVM::MJIT.enabled?
|
||||||
data = IO.popen("-", "r+") do |f|
|
data = IO.popen("-", "r+") do |f|
|
||||||
break f.read if f
|
break f.read if f
|
||||||
Process.daemon
|
Process.daemon
|
||||||
|
|
@ -1773,6 +1774,7 @@ class TestProcess < Test::Unit::TestCase
|
||||||
|
|
||||||
if File.directory?("/proc/self/task") && /netbsd[a-z]*[1-6]/ !~ RUBY_PLATFORM
|
if File.directory?("/proc/self/task") && /netbsd[a-z]*[1-6]/ !~ RUBY_PLATFORM
|
||||||
def test_daemon_no_threads
|
def test_daemon_no_threads
|
||||||
|
skip 'Process.daemon in IO.popen block deadlocks with MJIT [Bug #15320]' if RubyVM::MJIT.enabled?
|
||||||
pid, data = IO.popen("-", "r+") do |f|
|
pid, data = IO.popen("-", "r+") do |f|
|
||||||
break f.pid, f.readlines if f
|
break f.pid, f.readlines if f
|
||||||
Process.daemon(true, true)
|
Process.daemon(true, true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue