diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-22 06:24:54 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-22 06:24:54 +0000 |
commit | f5b15f0e3f6d3f3b3467059802e24c8de0d9d361 (patch) | |
tree | 714c98acc6dabd7d4b0959744ae4eac36c325c82 /thread.c | |
parent | 3636f8c0f56ddf15e26e28e7a38e748588fad976 (diff) | |
download | ruby-f5b15f0e3f6d3f3b3467059802e24c8de0d9d361.tar.gz |
* vm_trace.c: exterminate Zombies.
There is a bug that T_ZOMBIE objects are not collected.
Because there is a pass to miss finalizer postponed job
with multi-threading. This patch solve this issue.
* vm_trace.c (rb_postponed_job_register_one): set
RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) if another same job
is registered.
There is a possibility to remain a postponed job without
interrupt flag.
* vm_trace.c (rb_postponed_job_register_one): check interrupt
carefully.
* vm_trace.c (rb_postponed_job_register_one): use additional space
to avoid buffer full.
* gc.c (gc_finalize_deferred_register): check failure.
* thread.c (rb_threadptr_execute_interrupts): check
`postponed_job_interrupt' immediately. There is a possibility
to miss this flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1956,6 +1956,10 @@ rb_threadptr_execute_interrupts(rb_thread_t *th, int blocking_timing) postponed_job_interrupt = interrupt & POSTPONED_JOB_INTERRUPT_MASK; trap_interrupt = interrupt & TRAP_INTERRUPT_MASK; + if (postponed_job_interrupt) { + rb_postponed_job_flush(th->vm); + } + /* signal handling */ if (trap_interrupt && (th == th->vm->main_thread)) { enum rb_thread_status prev_status = th->status; @@ -2004,10 +2008,6 @@ rb_threadptr_execute_interrupts(rb_thread_t *th, int blocking_timing) rb_thread_schedule_limits(limits_us); } } - - if (postponed_job_interrupt) { - rb_postponed_job_flush(th->vm); - } } void |