I agree with @Eregon (Benoit Daloze) that we can probably change the return value of ConditionVariable#wait in Ruby 3. As it always returns true currently, it's worthless and nothing should be relying on it.
I can see that changing Mutex#sleep to start returning nil could break things, though. I think we do need a new method. Maybe Mutex#sleep_for or Mutex#sleep!.
I've added a pull request that builds on @nobu's pull request, but uses a new method (Mutex#sleep_for) instead of making backwards-incompatible changes to Mutex#sleep: https://github.com/ruby/ruby/pull/4256
So the Mutex_m test needs to be fixed first, a new release needs to be made, and the bundled gems need to be updated, before the Mutex#sleep change can be merged.
Assignee changed from nobu (Nobuyoshi Nakada) to soutaro (Soutaro Matsumoto)
I submitted a pull request to rbs to fix the failure (https://github.com/ruby/rbs/pull/683) I also updated the ruby pull request (https://github.com/ruby/ruby/pull/4256) to rebase it on the current master branch. Once the rbs pull request is merged and a release is made, we should be able to merge the ruby pull request.
The rbs pull request has been merged. So we just need to wait for the next rbs gem release and for bundled gems to be updated, then we can merge the pull request.