Skip to content

Move Monitor to native#6534

Merged
headius merged 2 commits intojruby:masterfrom
headius:monitor_ext
Jan 14, 2021
Merged

Move Monitor to native#6534
headius merged 2 commits intojruby:masterfrom
headius:monitor_ext

Conversation

@headius
Copy link
Member

@headius headius commented Jan 14, 2021

See ruby/ruby#2576 which did the same for CRuby 2.7.

This eliminates the need for the monitor.rb fixes in #6527 and ruby/monitor#2, plus synchronize will perform significantly better than the nested block implementation.

This may be safe to include in 9.3 even though the compatibility level is 2.6.

@headius headius added this to the JRuby 9.3.0.0 milestone Jan 14, 2021
@headius
Copy link
Member Author

headius commented Jan 14, 2021

The most likely vector for compatibility issues here is the removal of MonitorMixin from Monitor's includes. Before, Monitor included MonitorMixin to get most of its functionality, but Monitor is the captain now.

https://github.com/jruby/jruby/pull/6534/files#diff-932b5c8ed1b8e197d26de4132979a13401fa78b07cbb1faf1c742851748674d8L306

* Add classes to Ruby interface
* Pass in everything needed to avoid self-referencing Ruby during
  init
* Use method references for allocator
This mimics the change in CRuby 2.7 from this PR:

ruby/ruby#2576

This makes the fixes from jruby#6527 and ruby/monitor#2 irrelevant due
to the lack of Ruby interrupts in native code.
@headius headius merged commit 778c5ae into jruby:master Jan 14, 2021
@headius headius deleted the monitor_ext branch January 14, 2021 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant