20
20
import com .linkedin .parseq .promise .Promise ;
21
21
import com .linkedin .parseq .promise .Promises ;
22
22
import com .linkedin .parseq .promise .SettablePromise ;
23
- import com .linkedin .parseq .trace .ShallowTrace ;
24
- import com .linkedin .parseq .trace .ShallowTraceBuilder ;
25
23
26
24
import java .util .ArrayList ;
27
25
import java .util .Collections ;
30
28
/**
31
29
* A {@link Task} that will run the constructor-supplied tasks one after the other.
32
30
* <p/>
33
- * Use {@link Tasks#seq(Iterable)} or {@link Tasks#seq(Task[] )} to create
31
+ * Use {@link Tasks#seq(Iterable)} or {@link Tasks#seq(java.lang.Iterable )} to create
34
32
* instances of this class.
35
33
*
36
34
* @author Chris Pettitt ([email protected] )
37
35
* @author Chi Chan ([email protected] )
38
36
*/
39
37
/* package private */ class SeqTask <T > extends SystemHiddenTask <T >
40
38
{
41
- private final List <Task <?>> _tasks ;
39
+ private volatile List <Task <?>> _tasks ;
42
40
43
41
public SeqTask (final String name , final Iterable <? extends Task <?>> tasks )
44
42
{
@@ -54,7 +52,6 @@ public SeqTask(final String name, final Iterable<? extends Task<?>> tasks)
54
52
throw new IllegalArgumentException ("No tasks to sequence!" );
55
53
}
56
54
57
-
58
55
_tasks = Collections .unmodifiableList (taskList );
59
56
}
60
57
@@ -77,6 +74,9 @@ protected Promise<? extends T> run(final Context context) throws Exception
77
74
final Task <T > typedPrevTask = (Task <T >)prevTask ;
78
75
Promises .propagateResult (typedPrevTask , result );
79
76
context .run (_tasks .get (0 ));
77
+
78
+ _tasks = null ;
79
+
80
80
return result ;
81
81
}
82
82
}
0 commit comments