commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/pool/src/java/org/apache/commons/pool/impl GenericObjectPool.java
Date Wed, 13 Aug 2003 19:05:23 GMT
dirkv       2003/08/13 12:05:23

  Modified:    pool/src/java/org/apache/commons/pool/impl
                        GenericObjectPool.java
  Log:
  synchronized numActive++
  
  Revision  Changes    Path
  1.23      +10 -6     jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
  
  Index: GenericObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericObjectPool.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- GenericObjectPool.java	13 Aug 2003 12:42:28 -0000	1.22
  +++ GenericObjectPool.java	13 Aug 2003 19:05:23 -0000	1.23
  @@ -738,7 +738,9 @@
                   // (note we know that the num sleeping is 0, else we wouldn't be here)
                   if(_maxActive <= 0 || _numActive < _maxActive) {
                       try {
  -                        _numActive++;
  +                        synchronized(this) {
  +                            _numActive++;
  +                        }
                           Object obj = _factory.makeObject();
                           pair = new ObjectTimestampPair(obj);
                           newlyCreated = true;
  @@ -756,7 +758,9 @@
                       switch(_whenExhaustedAction) {
                           case WHEN_EXHAUSTED_GROW:
                               try {
  -                                _numActive++;
  +                                synchronized(this) {
  +                                    _numActive++;
  +                                }
                                   Object obj = _factory.makeObject();
                                   pair = new ObjectTimestampPair(obj);
                                   newlyCreated = true;
  
  
  

Mime
View raw message