class Concurrent::AbstractExchanger

def exchange!(value, timeout = nil)

Raises:
  • (Concurrent::TimeoutError) - on timeout

Returns:
  • (Object) - the value exchanged by the other thread
def exchange!(value, timeout = nil)
  if (value = do_exchange(value, timeout)) == CANCEL
    raise Concurrent::TimeoutError
  else
    value
  end
end