You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2010/06/01 23:46:13 UTC

svn commit: r950253 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/concurrent/DependencyPool.java

Author: doogie
Date: Tue Jun  1 21:46:13 2010
New Revision: 950253

URL: http://svn.apache.org/viewvc?rev=950253&view=rev
Log:
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) {