summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-28 13:40:56 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-28 13:40:56 +0000
commit67db9280bf681b35ecf10c17ebd936acc3061d4a (patch)
tree8640e675e4bf060163a99f44bd7cc23c6caebcb0 /thread.c
parent4ed5cda95148e2a355fb916f21f06e529bf375a2 (diff)
merges r30743 from trunk into ruby_1_9_2.
-- * thread.c (thread_start_func_2): check deadlock condition before release thread stack. fix memory violation when deadlock detected. reported by Max Aller. [Bug #4009] [ruby-core:32982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index 4022f60bca..09a9f94fac 100644
--- a/thread.c
+++ b/thread.c
@@ -512,13 +512,14 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
join_th = join_th->join_list_next;
}
+ thread_unlock_all_locking_mutexes(th);
+ if (th != main_th) rb_check_deadlock(th->vm);
+
if (!th->root_fiber) {
rb_thread_recycle_stack_release(th->stack);
th->stack = 0;
}
}
- thread_unlock_all_locking_mutexes(th);
- if (th != main_th) rb_check_deadlock(th->vm);
if (th->vm->main_thread == th) {
ruby_cleanup(state);
}