Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various autoload race conditions. #5898

Merged
merged 5 commits into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ The following deprecated APIs are removed.

## Implementation improvements

* Fixed several race conditions in `Kernel#autoload`. [[Bug #18782]]

## JIT

### MJIT
Expand Down Expand Up @@ -253,3 +255,4 @@ The following deprecated APIs are removed.
[Feature #18598]: https://bugs.ruby-lang.org/issues/18598
[Bug #18625]: https://bugs.ruby-lang.org/issues/18625
[Bug #18633]: https://bugs.ruby-lang.org/issues/18633
[Bug #18782]: https://bugs.ruby-lang.org/issues/18782
4 changes: 4 additions & 0 deletions thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,10 @@ static inline int
blocking_region_begin(rb_thread_t *th, struct rb_blocking_region_buffer *region,
rb_unblock_function_t *ubf, void *arg, int fail_if_interrupted)
{
#ifdef RUBY_VM_CRITICAL_SECTION
VM_ASSERT(rb_vm_critical_section_entered == 0);
#endif

region->prev_status = th->status;
if (unblock_function_set(th, ubf, arg, fail_if_interrupted)) {
th->blocking_region_buffer = region;
Expand Down
Loading