mirror of https://github.com/apache/lucene.git
LUCENE-4177: possible fix for thread-safety issue causing test to never stop
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1368618 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7fd7610b7a
commit
3c112d15e7
|
@ -331,7 +331,9 @@ public class TaskSequence extends PerfTask {
|
|||
// Forwards top request to children
|
||||
if (runningParallelTasks != null) {
|
||||
for(ParallelTask t : runningParallelTasks) {
|
||||
t.task.stopNow();
|
||||
if (t != null) {
|
||||
t.task.stopNow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -355,6 +357,12 @@ public class TaskSequence extends PerfTask {
|
|||
// run threads
|
||||
startThreads(t);
|
||||
|
||||
if (stopNow) {
|
||||
for (ParallelTask task : t) {
|
||||
task.task.stopNow();
|
||||
}
|
||||
}
|
||||
|
||||
// wait for all threads to complete
|
||||
int count = 0;
|
||||
for (int i = 0; i < t.length; i++) {
|
||||
|
|
Loading…
Reference in New Issue