Skip to content
Snippets Groups Projects
Commit 1502a623 authored by Christian Wulf's avatar Christian Wulf
Browse files

removed sending InitializingSignal twice

parent a285c692
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,6 @@ import org.slf4j.LoggerFactory; ...@@ -29,7 +29,6 @@ import org.slf4j.LoggerFactory;
import teetime.framework.exceptionHandling.AbstractExceptionListener; import teetime.framework.exceptionHandling.AbstractExceptionListener;
import teetime.framework.exceptionHandling.IExceptionListenerFactory; import teetime.framework.exceptionHandling.IExceptionListenerFactory;
import teetime.framework.exceptionHandling.TerminatingExceptionListenerFactory; import teetime.framework.exceptionHandling.TerminatingExceptionListenerFactory;
import teetime.framework.signal.InitializingSignal;
import teetime.framework.signal.ValidatingSignal; import teetime.framework.signal.ValidatingSignal;
import teetime.framework.validation.AnalysisNotValidException; import teetime.framework.validation.AnalysisNotValidException;
import teetime.util.ThreadThrowableContainer; import teetime.util.ThreadThrowableContainer;
...@@ -174,25 +173,21 @@ public final class Execution<T extends Configuration> implements UncaughtExcepti ...@@ -174,25 +173,21 @@ public final class Execution<T extends Configuration> implements UncaughtExcepti
switch (terminationStrategy) { switch (terminationStrategy) {
case BY_SIGNAL: { case BY_SIGNAL: {
final RunnableConsumerStage runnable = new RunnableConsumerStage(stage); final RunnableConsumerStage runnable = new RunnableConsumerStage(stage);
thread = createThread(runnable, stage.getId()); thread = createThread(runnable);
this.consumerThreads.add(thread); this.consumerThreads.add(thread);
break; break;
} }
case BY_SELF_DECISION: { case BY_SELF_DECISION: {
final RunnableProducerStage runnable = new RunnableProducerStage(stage); final RunnableProducerStage runnable = new RunnableProducerStage(stage);
producerRunnables.add(runnable); producerRunnables.add(runnable);
thread = createThread(runnable, stage.getId()); thread = createThread(runnable);
this.finiteProducerThreads.add(thread); this.finiteProducerThreads.add(thread);
InitializingSignal initializingSignal = new InitializingSignal();
stage.onSignal(initializingSignal, null);
break; break;
} }
case BY_INTERRUPT: { case BY_INTERRUPT: {
final RunnableProducerStage runnable = new RunnableProducerStage(stage); final RunnableProducerStage runnable = new RunnableProducerStage(stage);
producerRunnables.add(runnable); producerRunnables.add(runnable);
thread = createThread(runnable, stage.getId()); thread = createThread(runnable);
InitializingSignal initializingSignal = new InitializingSignal();
stage.onSignal(initializingSignal, null);
this.infiniteProducerThreads.add(thread); this.infiniteProducerThreads.add(thread);
break; break;
} }
...@@ -202,7 +197,7 @@ public final class Execution<T extends Configuration> implements UncaughtExcepti ...@@ -202,7 +197,7 @@ public final class Execution<T extends Configuration> implements UncaughtExcepti
return thread; return thread;
} }
private Thread createThread(final AbstractRunnableStage runnable, final String name) { private Thread createThread(final AbstractRunnableStage runnable) {
final Thread thread = new Thread(runnable); final Thread thread = new Thread(runnable);
thread.setUncaughtExceptionHandler(this); thread.setUncaughtExceptionHandler(this);
thread.setName(configuration.getContext().getThreadableStages().get(runnable.stage)); thread.setName(configuration.getContext().getThreadableStages().get(runnable.stage));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment