From adec8b726cb6a9e7b053b83592358cb8c0d2c537 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 19 Jul 2003 03:18:44 +0000 Subject: * eval.c (thgroup_add): do not raise ThreadError on terminated thread addition for compatibility. just warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 94e5257168..cebf94bb69 100644 --- a/eval.c +++ b/eval.c @@ -9937,9 +9937,6 @@ thgroup_add(group, thread) if (OBJ_FROZEN(th->thgroup)) { rb_raise(rb_eThreadError, "can't move from the frozen thread group"); } - if (!th->thgroup) { - rb_raise(rb_eThreadError, "terminated thread"); - } Data_Get_Struct(th->thgroup, struct thgroup, data); if (data->enclosed) { rb_raise(rb_eThreadError, "can't move from the enclosed thread group"); @@ -9953,6 +9950,10 @@ thgroup_add(group, thread) rb_raise(rb_eThreadError, "can't move to the enclosed thread group"); } + if (!th->thgroup) { + rb_warn(rb_eThreadError, "terminated thread"); + return; + } th->thgroup = group; return group; } -- cgit v1.2.3