Bug #11384 ยป 0001-autoload-always-wait-on-loading-thread.patch
variable.c | ||
---|---|---|
1987 | 1987 |
if (!RSTRING_LEN(file) || !*RSTRING_PTR(file)) { |
1988 | 1988 |
rb_raise(rb_eArgError, "empty file name"); |
1989 | 1989 |
} |
1990 | ||
1991 |
/* |
|
1992 |
* if somebody else is autoloading, we MUST wait for them, since |
|
1993 |
* rb_provide_feature can provide a feature before autoload_const_set |
|
1994 |
* completes. We must wait until autoload_const_set finishes in |
|
1995 |
* the other thread. |
|
1996 |
*/ |
|
1997 |
if (ele->state && ele->state->thread != rb_thread_current()) { |
|
1998 |
return load; |
|
1999 |
} |
|
2000 | ||
1990 | 2001 |
loading = RSTRING_PTR(file); |
1991 | 2002 |
safe = rb_safe_level(); |
1992 | 2003 |
rb_set_safe_level_force(0); |
1993 |
- |