Extract vm_locked_by_ractor_p

This introduces a new method to encapsulate checking whether the current
Ractor owns the vm->ractor.sync lock. This allows us to disable TSan on
it since that operation should be safe, and still get validation of
other uses.
This commit is contained in:
John Hawthorn 2025-07-23 14:24:59 -07:00
parent 7465e169da
commit 3ad2019259
3 changed files with 11 additions and 9 deletions

View file

@ -12,7 +12,7 @@ void rb_ractor_sched_barrier_end(rb_vm_t *vm, rb_ractor_t *cr);
static bool
vm_locked(rb_vm_t *vm)
{
return vm->ractor.sync.lock_owner == GET_RACTOR();
return vm_locked_by_ractor_p(vm, GET_RACTOR());
}
#if RUBY_DEBUG > 0