* thread.c (thread_start_func_2): small cleanups.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e606aee2f
commit
b76b6b5c98
@ -1,3 +1,7 @@
|
|||||||
|
Thu Nov 29 06:46:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* thread.c (thread_start_func_2): small cleanups.
|
||||||
|
|
||||||
Thu Nov 29 06:37:08 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Thu Nov 29 06:37:08 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* thread.c (thread_start_func_2): remove unused code.
|
* thread.c (thread_start_func_2): remove unused code.
|
||||||
|
19
thread.c
19
thread.c
@ -500,6 +500,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
|
|||||||
}
|
}
|
||||||
th->value = Qnil;
|
th->value = Qnil;
|
||||||
}
|
}
|
||||||
|
TH_POP_TAG();
|
||||||
|
|
||||||
th->status = THREAD_KILLED;
|
th->status = THREAD_KILLED;
|
||||||
thread_debug("thread end: %p\n", (void *)th);
|
thread_debug("thread end: %p\n", (void *)th);
|
||||||
@ -509,13 +510,6 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
|
|||||||
/* treat with normal error object */
|
/* treat with normal error object */
|
||||||
rb_threadptr_raise(main_th, 1, &errinfo);
|
rb_threadptr_raise(main_th, 1, &errinfo);
|
||||||
}
|
}
|
||||||
TH_POP_TAG();
|
|
||||||
|
|
||||||
/* locking_mutex must be Qfalse */
|
|
||||||
if (th->locking_mutex != Qfalse) {
|
|
||||||
rb_bug("thread_start_func_2: locking_mutex must not be set (%p:%"PRIxVALUE")",
|
|
||||||
(void *)th, th->locking_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* delete self other than main thread from living_threads */
|
/* delete self other than main thread from living_threads */
|
||||||
st_delete_wrap(th->vm->living_threads, th->self);
|
st_delete_wrap(th->vm->living_threads, th->self);
|
||||||
@ -524,6 +518,14 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
|
|||||||
rb_threadptr_interrupt(main_th);
|
rb_threadptr_interrupt(main_th);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* locking_mutex must be Qfalse */
|
||||||
|
if (th->locking_mutex != Qfalse) {
|
||||||
|
rb_bug("thread_start_func_2: locking_mutex must not be set (%p:%"PRIxVALUE")",
|
||||||
|
(void *)th, th->locking_mutex);
|
||||||
|
}
|
||||||
|
rb_threadptr_unlock_all_locking_mutexes(th);
|
||||||
|
rb_check_deadlock(th->vm);
|
||||||
|
|
||||||
/* wake up joining threads */
|
/* wake up joining threads */
|
||||||
join_list = th->join_list;
|
join_list = th->join_list;
|
||||||
while (join_list) {
|
while (join_list) {
|
||||||
@ -536,9 +538,6 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
|
|||||||
join_list = join_list->next;
|
join_list = join_list->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_threadptr_unlock_all_locking_mutexes(th);
|
|
||||||
rb_check_deadlock(th->vm);
|
|
||||||
|
|
||||||
if (!th->root_fiber) {
|
if (!th->root_fiber) {
|
||||||
rb_thread_recycle_stack_release(th->stack);
|
rb_thread_recycle_stack_release(th->stack);
|
||||||
th->stack = 0;
|
th->stack = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user