how to set breakpoint at Mutex#lock?

58 Views Asked by At

I'm trying to set a breakpoint every time Mutex#lock is called in RubyMine, but since mutex.rb is a stub I can't seem to do it. Anybody know how I would do this?

1

There are 1 best solutions below

0
Mohamed Hafez On

I ended up just defining the following in a file and putting breakpoints there:

class Mutex
  alias real_lock lock
  alias real_synchronize synchronize

  def lock
    real_lock
  end

  def synchronize &block
    real_synchronize &block
  end
end