1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* thread.c (thread_unlock_all_locking_mutexes): rename to

rb_threadptr_unlock_all_locking_mutexes and remove static.
* vm_core.h: add rb_threadptr_unlock_all_locking_mutexes declaration.
* thread.c (thread_start_func_2): adjust the above rename.

* eval.c (ruby_cleanup): call rb_threadptr_unlock_all_locking_mutexes
  again after finalizer. [Bug #4988] [ruby-dev:44049]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-07-08 04:40:01 +00:00
parent 4ad2d02a49
commit 8741274529
4 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,13 @@
Fri Jul 8 13:36:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c (thread_unlock_all_locking_mutexes): rename to
rb_threadptr_unlock_all_locking_mutexes and remove static.
* vm_core.h: add rb_threadptr_unlock_all_locking_mutexes declaration.
* thread.c (thread_start_func_2): adjust the above rename.
* eval.c (ruby_cleanup): call rb_threadptr_unlock_all_locking_mutexes
again after finalizer. [Bug #4988] [ruby-dev:44049]
Fri Jul 8 13:06:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* cont.c (FIBER_MACHINE_STACK_ALLOCATION_SIZE): Fiber stack size

3
eval.c
View file

@ -145,6 +145,9 @@ ruby_cleanup(volatile int ex)
th->errinfo = errs[1];
ex = error_handle(ex);
ruby_finalize_1();
/* unlock again if finalizer took mutexes. */
rb_threadptr_unlock_all_locking_mutexes(GET_THREAD());
POP_TAG();
rb_thread_stop_timer_thread(1);

View file

@ -365,8 +365,8 @@ rb_thread_terminate_all(void)
}
}
static void
thread_unlock_all_locking_mutexes(rb_thread_t *th)
void
rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th)
{
if (th->keeping_mutexes) {
rb_mutex_unlock_all(th->keeping_mutexes, th);
@ -517,7 +517,7 @@ 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);
rb_threadptr_unlock_all_locking_mutexes(th);
if (th != main_th) rb_check_deadlock(th->vm);
if (!th->root_fiber) {

View file

@ -702,6 +702,7 @@ void rb_threadptr_signal_raise(rb_thread_t *th, int sig);
void rb_threadptr_signal_exit(rb_thread_t *th);
void rb_threadptr_execute_interrupts(rb_thread_t *);
void rb_threadptr_interrupt(rb_thread_t *th);
void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th);
void rb_thread_lock_unlock(rb_thread_lock_t *);
void rb_thread_lock_destroy(rb_thread_lock_t *);