Object
The Monitor class in Ruby 1.8 has some bugs and also threads may not be available on all runtimes. This class provides a simple, safe re-entrant mutex as an alternative.
Acquire an exclusive lock.
# File lib/ref/safe_monitor.rb, line 18 def lock if @mutex if @owner != Thread.current.object_id @mutex.lock @owner = Thread.current.object_id end @count += 1 end true end
Generated with the Darkfish Rdoc Generator 2.