diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-05 03:50:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-05 03:50:04 +0000 |
commit | e47532c39363600fb1e377f1f9dccc5101153321 (patch) | |
tree | 84dfaa93df999e41180776b07dc3ca9046a568fe /eval.c | |
parent | 5bfb76918cabbc7fca402c842689e57ebb59faa0 (diff) | |
download | ruby-e47532c39363600fb1e377f1f9dccc5101153321.tar.gz ruby-e47532c39363600fb1e377f1f9dccc5101153321.tar.xz ruby-e47532c39363600fb1e377f1f9dccc5101153321.zip |
* eval.c (rb_thread_initialize): Thread objects cannot be initialized
again. fixed: [ruby-core:04067]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -11698,10 +11698,21 @@ static VALUE rb_thread_initialize(thread, args) VALUE thread, args; { + rb_thread_t th; + if (!rb_block_given_p()) { rb_raise(rb_eThreadError, "must be called with a block"); } - return rb_thread_start_0(rb_thread_yield, args, rb_thread_check(thread)); + th = rb_thread_check(thread); + if (th->stk_max) { + NODE *node = th->node; + if (!node) { + rb_raise(rb_eThreadError, "already initialized thread"); + } + rb_raise(rb_eThreadError, "already initialized thread - %s:%d", + node->nd_file, nd_line(node)); + } + return rb_thread_start_0(rb_thread_yield, args, th); } |