From 6a898449c87603a2e98bbcaadc2aa65963d0382f Mon Sep 17 00:00:00 2001
From: Christian Wulf <chw@informatik.uni-kiel.de>
Date: Fri, 13 Feb 2015 11:24:33 +0100
Subject: [PATCH] added launch config; removed unused code in UnboundedSpScPipe

---
 run-configurations/mvn-package (teetime).launch  | 16 ++++++++++++++++
 .../framework/pipe/UnboundedSpScPipe.java        | 15 +--------------
 2 files changed, 17 insertions(+), 14 deletions(-)
 create mode 100644 run-configurations/mvn-package (teetime).launch

diff --git a/run-configurations/mvn-package (teetime).launch b/run-configurations/mvn-package (teetime).launch
new file mode 100644
index 00000000..7912737c
--- /dev/null
+++ b/run-configurations/mvn-package (teetime).launch	
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
+<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
+<stringAttribute key="M2_GOALS" value="clean package"/>
+<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
+<booleanAttribute key="M2_OFFLINE" value="false"/>
+<stringAttribute key="M2_PROFILES" value=""/>
+<listAttribute key="M2_PROPERTIES"/>
+<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
+<booleanAttribute key="M2_SKIP_TESTS" value="true"/>
+<intAttribute key="M2_THREADS" value="1"/>
+<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
+<stringAttribute key="M2_USER_SETTINGS" value=""/>
+<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="I:/Repositories/teetime"/>
+</launchConfiguration>
diff --git a/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java b/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java
index 87cfff3a..07f906a8 100644
--- a/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java
+++ b/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java
@@ -29,8 +29,6 @@ import teetime.framework.OutputPort;
 public final class UnboundedSpScPipe extends AbstractInterThreadPipe {
 
 	private final Queue<Object> queue;
-	// statistics
-	private int numWaits;
 
 	<T> UnboundedSpScPipe(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
 		super(sourcePort, targetPort);
@@ -40,13 +38,7 @@ public final class UnboundedSpScPipe extends AbstractInterThreadPipe {
 
 	@Override
 	public boolean add(final Object element) {
-		// BETTER introduce a QueueIsFullStrategy
-		while (!this.queue.offer(element)) {
-			this.numWaits++;
-			Thread.yield();
-		}
-		// this.reportNewElement();
-		return true;
+		return this.queue.offer(element);
 	}
 
 	@Override
@@ -69,9 +61,4 @@ public final class UnboundedSpScPipe extends AbstractInterThreadPipe {
 		return this.queue.peek();
 	}
 
-	// BETTER find a solution w/o any thread-safe code in this stage
-	public synchronized int getNumWaits() {
-		return this.numWaits;
-	}
-
 }
-- 
GitLab