def exec(lock)
    lock.synchronize {
      @thread = Thread.current
      @time_started = Time.now
    }

    @handler.call *@params

    # ensure we do not switch to another job
    # before atomic check expiration / terminate
    # expired threads happens below
    lock.synchronize {
      @time_completed = Time.now
      @thread = nil
    }
  end
def exec(lock)
    lock.synchronize {
      @thread = Thread.current
      @time_started = Time.now
    }

    @handler.call *@params

    # ensure we do not switch to another job
    # before atomic check expiration / terminate
    # expired threads happens below
    lock.synchronize {
      @time_completed = Time.now
      @thread = nil
    }
  end
Set job metadata and execute job with specified params.

 Used internally by thread pool