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

* vm.c (thread_free): reset ruby_current_thread if it points the

thread to free.
* gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if
  there is no current thread.
  [ruby-dev:43000]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-01-12 10:35:36 +00:00
parent e1680f8cc1
commit fd2f238560
3 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,11 @@
Wed Jan 12 19:28:23 2011 Tanaka Akira <akr@fsij.org>
* vm.c (thread_free): reset ruby_current_thread if it points the
thread to free.
* gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if
there is no current thread.
[ruby-dev:43000]
Wed Jan 12 19:09:29 2011 Tanaka Akira <akr@fsij.org>
* enum.c (sort_by_i): reenter check more strictly.

5
gc.c
View file

@ -1958,7 +1958,10 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
objspace->heap.final_num += final_num;
if (deferred_final_list) {
RUBY_VM_SET_FINALIZER_INTERRUPT(GET_THREAD());
rb_thread_t *th = GET_THREAD();
if (th) {
RUBY_VM_SET_FINALIZER_INTERRUPT(th);
}
}
}

2
vm.c
View file

@ -1730,6 +1730,8 @@ thread_free(void *ptr)
#endif
ruby_xfree(ptr);
}
if (ruby_current_thread == th)
ruby_current_thread = NULL;
}
RUBY_FREE_LEAVE("thread");
}