Method: Selenium::WebDriver::SocketLock#locked

Defined in:
lib/selenium/webdriver/common/socket_lock.rb

#locked(&blk) ⇒ Object

Attempt to acquire a lock on the given port. Control is yielded to an execution block if the lock could be successfully obtained.

[View source]

34
35
36
37
38
39
40
41
42
# File 'lib/selenium/webdriver/common/socket_lock.rb', line 34

def locked(&blk)
  lock

  begin
    yield
  ensure
    release
  end
end