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
<code/>and<pre/>for code samples.