From ae693fff748c68ca2500bbc2c0a8802d50f269dc Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 14 Oct 2020 14:21:57 +0900 Subject: fix releasing timing. (1) recorded_lock_rec > current_lock_rec should not be occurred on rb_ec_vm_lock_rec_release(). (2) should be release VM lock at EXEC_TAG(), not POP_TAG(). (3) some refactoring. --- vm_core.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index f783bd5b99..e62d43d4aa 100644 --- a/vm_core.h +++ b/vm_core.h @@ -794,7 +794,7 @@ struct rb_vm_tag { rb_jmpbuf_t buf; struct rb_vm_tag *prev; enum ruby_tag_type state; - int lock_rec; + unsigned int lock_rec; }; STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0); @@ -1798,8 +1798,12 @@ rb_current_vm(void) return ruby_current_vm_ptr; } -static inline int -rb_ec_vm_lock_rec(rb_execution_context_t *ec) +void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec, + unsigned int recorded_lock_rec, + unsigned int current_lock_rec); + +static inline unsigned int +rb_ec_vm_lock_rec(const rb_execution_context_t *ec) { rb_vm_t *vm = rb_ec_vm_ptr(ec); -- cgit v1.2.3