summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-18 14:14:40 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-18 14:16:06 +0900
commitcfa124ef05e1b899c1953888c0fb3076388a0d8e (patch)
tree886b946bbe06b257b59046300be7cec8418263c7 /gc.c
parent8cba3b35e095bf17308ed00bf19f6d6f7a682ae2 (diff)
acquire VM lock on gc_verify_internal_consistency()
There is a case to call this function without VM lock acquiring.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gc.c b/gc.c
index f59ac6af33..d066ed9cf7 100644
--- a/gc.c
+++ b/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