def lock
      retries.times do
        atomically(timeout) do
          uid = available_uid
          if uid
            lock_uid uid
            return uid.to_i
          end
        end
        sleep(delay)
      end
      raise PoolTimeoutError.new('No available UIDs in the pool. Please try again later.')
    end
def lock
      retries.times do
        atomically(timeout) do
          uid = available_uid
          if uid
            lock_uid uid
            return uid.to_i
          end
        end
        sleep(delay)
      end
      raise PoolTimeoutError.new('No available UIDs in the pool. Please try again later.')
    end
Locks one UID from the pool, in a cross-process atomic manner
 @return [Integer]
 @raise [PoolTimeoutError] if no ID is available after retries