summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authorJean byroot Boussier <[email protected]>2023-02-06 23:30:42 +0100
committerJean Boussier <[email protected]>2023-02-08 09:50:00 +0100
commit8ce2fb9bbbaea14737c84385b1573f743a30f773 ()
treeb1909a3f62f01b61b19369028c698bc7fbc8692e /load.c
parent3ab34551450c7a3a3e1ae0b24bf6b78d26129dfa (diff)
Only emit circular dependency warning for owned thread shields
[Bug #19415] If multiple threads attemps to load the same file concurrently it's not a circular dependency issue. So we check that the existing ThreadShield is owner by the current fiber before warning about circular dependencies.
Notes: Merged: https://.com/ruby/ruby/pull/7257
-rw-r--r--load.c3
1 files changed, 2 insertions, 1 deletions
@@ -850,7 +850,8 @@ load_lock(rb_vm_t *vm, const char *ftptr, bool warn)
st_insert(loading_tbl, (st_data_t)ftptr, data);
return (char *)ftptr;
}
- if (warn) {
VALUE warning = rb_warning_string("loading in progress, circular require considered harmful - %s", ftptr);
rb_backtrace_each(rb_str_append, warning);
rb_warning("%"PRIsVALUE, warning);