aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index cdba4a2106..5214c68955 100644
--- a/thread.c
+++ b/thread.c
@@ -739,6 +739,9 @@ thread_join(rb_thread_t *target_th, double delay)
if (th == target_th) {
rb_raise(rb_eThreadError, "Target thread must not be current thread");
}
+ if (GET_VM()->main_thread == target_th) {
+ rb_raise(rb_eThreadError, "Target thread must not be main thread");
+ }
arg.target = target_th;
arg.waiting = th;