public Method

Mutex.try_lock

Attempts to obtain the lock and returns immediately. Returns true if the lock was granted.

Source Code

# File thread.rb, line 78
def try_lock
  result = false
  Thread.critical = true
  unless @locked
    @locked = true
    result = true
  end
  Thread.critical = false
  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.