We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 517c106 commit ab86ec6Copy full SHA for ab86ec6
1 file changed
symbol.c
@@ -836,13 +836,18 @@ rb_intern(const char *name)
836
ID
837
rb_intern_str(VALUE str)
838
{
839
- VALUE sym = lookup_str_sym(str);
840
-
841
- if (sym) {
842
- return SYM2ID(sym);
+ ID id;
+ GLOBAL_SYMBOLS_LOCKING(symbols) {
+ VALUE sym = lookup_str_sym(str);
+ if (sym) {
843
+ id = SYM2ID(sym);
844
+ }
845
+ else {
846
+ id = intern_str(str, 0);
847
848
}
849
- return intern_str(str, 0);
850
+ return id;
851
852
853
void
0 commit comments