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

thread_pthread.c: call SUSPENDED event when entering native_sleep #6101

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

casperisfine
Copy link
Contributor

@casperisfine casperisfine commented Jul 7, 2022

[Bug #18900]

Ref: https://bugs.ruby-lang.org/issues/18900

Thread#join and a few other codepaths are using native sleep as a way to suspend the current thread. So we should call the relevant hook when this happen, otherwise some thread may transition directly from RESUMED to READY.

cc @ivoanjo

@byroot byroot requested a review from ko1 July 7, 2022 13:26
@ivoanjo
Copy link
Contributor

ivoanjo commented Jul 7, 2022

This is great, thanks! :D

[Bug #18900]

Thread#join and a few other codepaths are using native sleep as
a way to suspend the current thread. So we should call the relevant
hook when this happen, otherwise some thread may transition
directly from `RESUMED` to `READY`.
@casperisfine casperisfine force-pushed the gvl-instrumentation-thread-join branch from eda6c7c to a24da89 Compare July 7, 2022 13:52
@byroot byroot merged commit 587d2d1 into ruby:master Jul 7, 2022
@byroot
Copy link
Member

byroot commented Jul 7, 2022

🤦 I had two tabs open and merged the wrong PR.

@ko1 if this fix doesn't seem correct to you let me know and I'll revert.

froydnj added a commit to sorbet/sorbet that referenced this pull request Feb 13, 2024
froydnj added a commit to sorbet/sorbet that referenced this pull request Feb 13, 2024
froydnj added a commit to sorbet/sorbet that referenced this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants