From 2162fed049614dfb80872941311a5e929f6cc5c8 Mon Sep 17 00:00:00 2001 From: Christian Wulf <chw@informatik.uni-kiel.de> Date: Fri, 13 Feb 2015 10:21:22 +0100 Subject: [PATCH] removed if in OutputPort --- src/main/java/teetime/framework/OutputPort.java | 8 +++----- .../java/teetime/framework/pipe/SingleElementPipe.java | 1 + src/main/java/teetime/framework/pipe/SpScPipe.java | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/teetime/framework/OutputPort.java b/src/main/java/teetime/framework/OutputPort.java index 7a2cda8a..1c49bfc6 100644 --- a/src/main/java/teetime/framework/OutputPort.java +++ b/src/main/java/teetime/framework/OutputPort.java @@ -25,18 +25,16 @@ public final class OutputPort<T> extends AbstractPort<T> { /** * @param element - * to be sent + * to be sent; May not be <code>null</code>. */ public void send(final T element) { - if (this.pipe.add(element)) { - this.pipe.reportNewElement(); - } + this.pipe.add(element); } /** * * @param signal - * to be sent + * to be sent; May not be <code>null</code>. */ public void sendSignal(final ISignal signal) { this.pipe.sendSignal(signal); diff --git a/src/main/java/teetime/framework/pipe/SingleElementPipe.java b/src/main/java/teetime/framework/pipe/SingleElementPipe.java index 587030bc..c6d51949 100644 --- a/src/main/java/teetime/framework/pipe/SingleElementPipe.java +++ b/src/main/java/teetime/framework/pipe/SingleElementPipe.java @@ -36,6 +36,7 @@ public final class SingleElementPipe extends AbstractIntraThreadPipe { @Override public boolean add(final Object element) { this.element = element; + this.reportNewElement(); return true; } diff --git a/src/main/java/teetime/framework/pipe/SpScPipe.java b/src/main/java/teetime/framework/pipe/SpScPipe.java index 947a5fb7..0641f975 100644 --- a/src/main/java/teetime/framework/pipe/SpScPipe.java +++ b/src/main/java/teetime/framework/pipe/SpScPipe.java @@ -53,6 +53,7 @@ public final class SpScPipe extends AbstractInterThreadPipe { this.numWaits++; Thread.yield(); } + // this.reportNewElement(); return true; } -- GitLab