Skip to content

Commit

Permalink
Remove change in lib/monitor.rb
Browse files Browse the repository at this point in the history
* It conflicts with using mon_initialize in initialize_copy.
* Fixes #1428.
  • Loading branch information
eregon committed Sep 20, 2018
1 parent 422d83d commit 7857f89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Bug fixes:
* Fixed problem with `Kernel.public_send` not tracking its caller properly (#1425).
* `rb_thread_call_without_gvl()` no longer holds the C-extensions lock.
* Fixed `caller_locations` when called inside `method_added`.
* Fixed `mon_initialize` when called inside `initialize_copy` (#1428).

Performance:

Expand Down
9 changes: 3 additions & 6 deletions lib/mri/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,9 @@ def initialize(*args)
# Initializes the MonitorMixin after being included in a class or when an
# object has been extended with the MonitorMixin
def mon_initialize
# In TruffleRuby avoid resetting the Mutex if mon_initialize is called twice, such as in Rails tests
if RUBY_ENGINE != 'truffleruby' || !@mon_mutex
@mon_owner = nil
@mon_count = 0
@mon_mutex = Thread::Mutex.new
end
@mon_owner = nil
@mon_count = 0
@mon_mutex = Thread::Mutex.new
end

def mon_check_owner
Expand Down

0 comments on commit 7857f89

Please sign in to comment.