Task.restart method.