public Method

MonitorMixin.mon_try_enter

Attempts to enter exclusive section. Returns false if lock fails.

Source Code

# File monitor.rb, line 193
def mon_try_enter
  result = false
  Thread.critical = true
  if @mon_owner.nil?
    @mon_owner = Thread.current
  end
  if @mon_owner == Thread.current
    @mon_count += 1
    result = true
  end
  Thread.critical = false
  return result
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.