aboutsummaryrefslogtreecommitdiffstats
path: root/vm_core.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-10-14 14:21:57 +0900
committerKoichi Sasada <ko1@atdot.net>2020-10-14 16:36:55 +0900
commitae693fff748c68ca2500bbc2c0a8802d50f269dc (patch)
treee96405ea3df4d2c03dce9cbe52503118005fc346 /vm_core.h
parent0714cb760c2b16f7d40e563b6ab9894553baf32c (diff)
downloadruby-ae693fff748c68ca2500bbc2c0a8802d50f269dc.tar.gz
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.
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h10
1 files changed, 7 insertions, 3 deletions
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);