$mutex = Mutex.newt1 = Thread.new { $mutex.lock; sleep 30 }sleep 1t2 = Thread.new do if $mutex.try_lock puts "Locked it" else puts "Could not lock" # Prints immediately endendsleep 2