summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 94e5257..cebf94b 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;
}