commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r328937 - /jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
Date Thu, 27 Oct 2005 19:23:56 GMT
Author: rdonkin
Date: Thu Oct 27 12:23:53 2005
New Revision: 328937

URL: http://svn.apache.org/viewcvs?rev=328937&view=rev
Log:
Added missed synchronization to StackKeyedObjectPool. Submitted by Sandy McArthur. Issue #37235.
Thanks to Mayur Naik for discovering and reporting these issues.

Modified:
    jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java

Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java?rev=328937&r1=328936&r2=328937&view=diff
==============================================================================
--- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
(original)
+++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
Thu Oct 27 12:23:53 2005
@@ -184,12 +184,10 @@
         notifyAll(); // _totalActive has changed
     }
 
-    public void addObject(Object key) throws Exception {
+    public synchronized void addObject(Object key) throws Exception {
         Object obj = _factory.makeObject(key);
-        synchronized(this) {
-            incrementActiveCount(key); // returnObject will decrement this
-            returnObject(key,obj);
-        }
+        incrementActiveCount(key); // returnObject will decrement this
+        returnObject(key,obj);
     }
 
     public int getNumIdle() {
@@ -200,7 +198,7 @@
         return _totActive;
     }
 
-    public int getNumActive(Object key) {
+    public synchronized int getNumActive(Object key) {
         return getActiveCount(key);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message