diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-10 08:15:39 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-10 08:15:39 +0000 |
commit | 38bc085f71ad2056f259ec60e4920acab392506b (patch) | |
tree | 0300a4c7be4944f68d3f278c229d1cb5f67fb338 /thread.c | |
parent | 92b710e64bf194266e3354c06fdb16dc7de0196d (diff) | |
download | ruby-38bc085f71ad2056f259ec60e4920acab392506b.tar.gz |
check thread deadness correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2107,6 +2107,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); |