Author: doogie
Date: Tue Jun 1 21:46:13 2010
New Revision: 950253
URL:
http://svn.apache.org/viewvc?rev=950253&view=revLog:
add() now returns the newly added item, or one that was added
concurrently by another thread.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/DependencyPool.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/DependencyPool.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/DependencyPool.java?rev=950253&r1=950252&r2=950253&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/DependencyPool.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/DependencyPool.java Tue Jun 1 21:46:13 2010
@@ -37,7 +37,7 @@ public class DependencyPool<K, I extends
this.executor = executor;
}
- public void add(I item) {
+ public I add(I item) {
if (allItems.putIfAbsent(item.getKey(), item) == null) {
submitLock.lock();
try {
@@ -46,6 +46,7 @@ public class DependencyPool<K, I extends
submitLock.unlock();
}
}
+ return allItems.get(item.getKey());
}
public void addAll(Collection<I> items) {