commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1051863 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
Date Wed, 22 Dec 2010 11:52:09 GMT
Author: simonetripodi
Date: Wed Dec 22 11:52:09 2010
New Revision: 1051863

URL: http://svn.apache.org/viewvc?rev=1051863&view=rev
Log:
made fields volatile
removed synchronization on getters/setters methods

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java?rev=1051863&r1=1051862&r2=1051863&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
Wed Dec 22 11:52:09 2010
@@ -81,13 +81,13 @@ public class StackKeyedObjectPoolFactory
     /**
      * cap on the number of "sleeping" instances in the pool
      */
-    private int maxSleeping; // @GuardedBy("this")
+    private volatile int maxSleeping; // @GuardedBy("this")
 
     /**
      * initial size of the pool (this specifies the size of the container,
      * it does not cause the pool to be pre-populated.)
      */
-    private int initIdleCapacity; // @GuardedBy("this")
+    private volatile int initIdleCapacity; // @GuardedBy("this")
 
     /**
      * Returns the KeyedPoolableObjectFactory used by StackKeyedObjectPools created by this
factory
@@ -105,7 +105,7 @@ public class StackKeyedObjectPoolFactory
      * @return maxSleeping setting for created pools
      * @since 1.5.5
      */
-    public synchronized int getMaxSleeping() {
+    public int getMaxSleeping() {
         return this.maxSleeping;
     }
 
@@ -115,7 +115,7 @@ public class StackKeyedObjectPoolFactory
      * @param maxSleeping
      * @since 2.0
      */
-    public synchronized void setMaxSleeping(int maxSleeping) {
+    public void setMaxSleeping(int maxSleeping) {
         this.maxSleeping = maxSleeping;
     }
 
@@ -125,7 +125,7 @@ public class StackKeyedObjectPoolFactory
      * @return initial capacity setting for created pools
      * @since 1.5.5
      */
-    public synchronized int getInitialCapacity() {
+    public int getInitialCapacity() {
         return this.initIdleCapacity;
     }
 
@@ -135,7 +135,7 @@ public class StackKeyedObjectPoolFactory
      * @param initIdleCapacity
      * @since 2.0
      */
-    public synchronized void setInitIdleCapacity(int initIdleCapacity) {
+    public void setInitIdleCapacity(int initIdleCapacity) {
         this.initIdleCapacity = initIdleCapacity;
     }
 



Mime
View raw message