summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bootstraptest/test_thread.rb9
-rw-r--r--insns.def7
3 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 387c5af448..2b113e3053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 27 22:55:29 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * insns.def (onceinlinecache): add exclusion control for a region
+ between onceinlinecache and setinlinecache. [ruby-dev:39768]
+
Tue Apr 27 22:40:54 2010 Yusuke Endoh <mame@tsg.ne.jp>
* iseq.c (set_relation): do not use top_wrapper as bottom of cref,
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 56c77259cf..2494cccbf3 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -443,3 +443,12 @@ assert_equal 'ok', %q{
'ok'
end
}
+
+assert_equal 'foo', %q{
+ f = proc {|s| /#{ sleep 1; s }/o }
+ [ Thread.new { f.call("foo"); nil },
+ Thread.new { sleep 0.5; f.call("bar"); nil },
+ ].each {|t| t.join }
+ GC.start
+ f.call.source
+}
diff --git a/insns.def b/insns.def
index 95414656bc..ba6f1d6627 100644
--- a/insns.def
+++ b/insns.def
@@ -1199,10 +1199,17 @@ onceinlinecache
()
(VALUE val)
{
+ retry:
if (ic->ic_vmstat) {
val = ic->ic_value.value;
JUMP(dst);
}
+ else if (ic->ic_value.value == Qundef)
+ {
+ RUBY_VM_CHECK_INTS();
+ rb_thread_schedule();
+ goto retry;
+ }
else {
/* none */
ic->ic_value.value = Qundef;