summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--eval.c13
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 02698e5a25..37d184bb4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jan 5 12:49:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_thread_initialize): Thread objects cannot be initialized
+ again. fixed: [ruby-core:04067]
+
Wed Jan 5 10:48:16 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* dir.c (dir_s_mkdir): win32 special processing doesn't need any
diff --git a/eval.c b/eval.c
index eb0fa3873b..3f0dec822a 100644
--- a/eval.c
+++ b/eval.c
@@ -11567,10 +11567,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);
}