diff options
author | Koichi Sasada <[email protected]> | 2020-10-14 14:21:57 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-10-14 16:36:55 +0900 |
commit | ae693fff748c68ca2500bbc2c0a8802d50f269dc (patch) | |
tree | e96405ea3df4d2c03dce9cbe52503118005fc346 /vm_core.h | |
parent | 0714cb760c2b16f7d40e563b6ab9894553baf32c (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3655
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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); |