diff options
author | Koichi Sasada <[email protected]> | 2020-09-16 09:04:13 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-09-18 14:17:49 +0900 |
commit | dd5db6f5fed359efc85cff25d326b5fc3de66614 (patch) | |
tree | fcbe09dae6d93286cb39fabeb8e2fd4ef5d2a469 /string.c | |
parent | 609e6ac0ca311fd38dbef09796dfc0102ccd4b83 (diff) |
sync fstring_table for deletion
Ractors can access this table simultaneously so we need to sync
accesses.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3548
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1378,8 +1378,13 @@ rb_str_free(VALUE str) { if (FL_TEST(str, RSTRING_FSTR)) { st_data_t fstr = (st_data_t)str; - st_delete(rb_vm_fstring_table(), &fstr, NULL); - RB_DEBUG_COUNTER_INC(obj_str_fstr); + + RB_VM_LOCK_ENTER(); + { + st_delete(rb_vm_fstring_table(), &fstr, NULL); + RB_DEBUG_COUNTER_INC(obj_str_fstr); + } + RB_VM_LOCK_LEAVE(); } if (STR_EMBED_P(str)) { |