/** * Constructs a base task with a name and type of task * * @param name the name for this task. * @param taskType the type of the task */ public BaseTask(final String name, final String taskType) { super(Promises.settable()); _name = truncate(name); final State state = State.INIT; _shallowTraceBuilder = new ShallowTraceBuilder(_id); _shallowTraceBuilder.setName(getName()); _shallowTraceBuilder.setResultType(ResultType.UNFINISHED); if (taskType != null) { _shallowTraceBuilder.setTaskType(taskType); } _stateRef = new AtomicReference<>(state); if (ParSeqGlobalConfiguration.isCrossThreadStackTracesEnabled()) { _taskStackTraceHolder = new Throwable(); } else { _taskStackTraceHolder = null; } }
/** * Constructs a base task with a name and type of task * * @param name the name for this task. * @param taskType the type of the task */ public BaseTask(final String name, final String taskType) { super(Promises.settable()); _name = truncate(name); final State state = State.INIT; _shallowTraceBuilder = new ShallowTraceBuilder(_id); _shallowTraceBuilder.setName(getName()); _shallowTraceBuilder.setResultType(ResultType.UNFINISHED); if (taskType != null) { _shallowTraceBuilder.setTaskType(taskType); } _stateRef = new AtomicReference<>(state); if (ParSeqGlobalConfiguration.isCrossThreadStackTracesEnabled()) { _taskStackTraceHolder = new Throwable(); } else { _taskStackTraceHolder = null; } }