summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-23 13:37:45 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-23 13:37:45 +0000
commit479d8ce5b5ba8ce22fdb6e92ed7e871f99d88735 (patch)
tree40250221e099a3ca989fce3cc69a008b44622be2 /thread.c
parent357a5f5ab527e7db6f009b8fae2aebae1debfd97 (diff)
* thread.c (thread_raise_m): check interrupts after Thread#raise
if a target thread is the current thread because the behavior of Thread.current.raise is expected to perform same as Kernel.raise (by rubyspec). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/thread.c b/thread.c
index 4b750b4dcc..b512566a0c 100644
--- a/thread.c
+++ b/thread.c
@@ -1894,9 +1894,15 @@ rb_thread_fd_close(int fd)
static VALUE
thread_raise_m(int argc, VALUE *argv, VALUE self)
{
- rb_thread_t *th;
- GetThreadPtr(self, th);
- rb_threadptr_raise(th, argc, argv);
+ rb_thread_t *target_th;
+ rb_thread_t *th = GET_THREAD();
+ GetThreadPtr(self, target_th);
+ rb_threadptr_raise(target_th, argc, argv);
+
+ /* To perform Thread.current.raise as Kernel.raise */
+ if (th == target_th) {
+ RUBY_VM_CHECK_INTS(th);
+ }
return Qnil;
}