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

added launch config;

removed unused code in UnboundedSpScPipe
parent 7a119502
No related branches found
No related tags found
No related merge requests found
<?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>
......@@ -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;
}
}
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