diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-19 21:22:46 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-19 21:22:46 +0000 |
commit | 84ccd55abd97f3bc9588bf71c0cfc9cfdf1003d4 (patch) | |
tree | df412b3b14adaf8cb0eb5c7a08003ef6b5c09949 /thread.c | |
parent | 63818379aa3c88681daf634c5f55b2cffac68283 (diff) |
merge revision(s) 57595: [Backport #8996]
check thread deadness correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2090,6 +2090,13 @@ rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv) else { exc = rb_make_exception(argc, argv); } + + /* making an exception object can switch thread, + so we need to check thread deadness again */ + if (rb_threadptr_dead(th)) { + return Qnil; + } + rb_threadptr_setup_exception(GET_THREAD(), exc, Qundef); rb_threadptr_pending_interrupt_enque(th, exc); rb_threadptr_interrupt(th); |