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

Removed thread and mutex_m dependencies #973

Closed
wants to merge 4 commits into from

Conversation

hsbt
Copy link

@hsbt hsbt commented Oct 19, 2023

Ruby core team have plan to extract mutex_m from stdlib at Ruby 3.4. After that, minitest needs to depend mutex_m gem.

I replaced mutex_m with simple Mutex usage. But I'm not familiar with thread programming. It may be wrong usage.

lib/minitest.rb Outdated
Comment on lines 660 to 662
def mutex # :nodoc:
@mutex
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def mutex # :nodoc:
@mutex
end
def synchronize(&block) # :nodoc:
@mutex.synchronize(&block)
end

This would be cleaner interface-wise and avoid exposing the Mutex.
Also it would avoid needing changes in lib/minitest/parallel.rb

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks. It's better than my changes.

@zenspider zenspider self-assigned this Oct 30, 2023
@zenspider
Copy link
Collaborator

DONE! Thank you. Sorry for the delay. I'll get this out in the next release shortly

@zenspider zenspider closed this Nov 10, 2023
@hsbt
Copy link
Author

hsbt commented Nov 10, 2023

@zenspider Thank you!

@hsbt hsbt deleted the replace-old-stdlib branch November 10, 2023 19:54
@Earlopain
Copy link

@zenspider hope you don't mind the ping. When do you except to cut the next release? Ruby main has now removed mutex_m code and as such testing against ruby-head errors unless manually adding it to the gemfile/gemspec.

@zenspider
Copy link
Collaborator

Just released v5.21.0 with this fix.

@Earlopain
Copy link

Thank you, I appreciate that very much.

@hsbt
Copy link
Author

hsbt commented Jan 12, 2024

Thanks always!

@minitest minitest locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants