diff options
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -794,6 +794,7 @@ struct rb_vm_tag { rb_jmpbuf_t buf; struct rb_vm_tag *prev; enum ruby_tag_type state; + int lock_rec; }; STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0); @@ -1797,6 +1798,19 @@ rb_current_vm(void) return ruby_current_vm_ptr; } +static inline int +rb_ec_vm_lock_rec(rb_execution_context_t *ec) +{ + rb_vm_t *vm = rb_ec_vm_ptr(ec); + + if (vm->ractor.sync.lock_owner != rb_ec_ractor_ptr(ec)) { + return 0; + } + else { + return vm->ractor.sync.lock_rec; + } +} + #else #error "unsupported thread model" #endif |