Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class · Ruby 3.4

Monitor

< Object 10 instance methods

Use the Monitor class when you want to have a lock object for blocks with mutual exclusion.

Example
require 'monitor'

lock = Monitor.new
lock.synchronize do
  # exclusive access
end

Instance methods 10