mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
acquire VM lock on gc_verify_internal_consistency()
There is a case to call this function without VM lock acquiring.
This commit is contained in:
parent
8cba3b35e0
commit
cfa124ef05
1 changed files with 10 additions and 7 deletions
17
gc.c
17
gc.c
|
@ -7142,15 +7142,18 @@ gc_verify_internal_consistency_(rb_objspace_t *objspace)
|
|||
static void
|
||||
gc_verify_internal_consistency(rb_objspace_t *objspace)
|
||||
{
|
||||
ASSERT_vm_locking();
|
||||
rb_vm_barrier(); // stop other ractors
|
||||
|
||||
unsigned int prev_during_gc = during_gc;
|
||||
during_gc = FALSE; // stop gc here
|
||||
RB_VM_LOCK_ENTER();
|
||||
{
|
||||
gc_verify_internal_consistency_(objspace);
|
||||
rb_vm_barrier(); // stop other ractors
|
||||
|
||||
unsigned int prev_during_gc = during_gc;
|
||||
during_gc = FALSE; // stop gc here
|
||||
{
|
||||
gc_verify_internal_consistency_(objspace);
|
||||
}
|
||||
during_gc = prev_during_gc;
|
||||
}
|
||||
during_gc = prev_during_gc;
|
||||
RB_VM_LOCK_LEAVE();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue