User: ejort   
  Date: 02/01/04 22:46:32

  Modified:    src/main/org/jboss/pool PoolGCThread.java
  Log:
  Guarded debug logging
  
  Revision  Changes    Path
  1.7       +11 -7     jbosspool/src/main/org/jboss/pool/PoolGCThread.java
  
  Index: PoolGCThread.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosspool/src/main/org/jboss/pool/PoolGCThread.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PoolGCThread.java 2001/12/07 03:40:39     1.6
  +++ PoolGCThread.java 2002/01/05 06:46:32     1.7
  @@ -29,24 +29,28 @@
      }
   
      public void run() {
  -      log.debug("Started gc thread");
  -      
  +      boolean debug = log.isDebugEnabled();
  +      if (debug)
  +         log.debug("Started gc thread");
  +
         while ( true ) {
            // Don't do anything while there's nothing to do
            waitForPools();
  -         log.debug("gc thread waited for pools");
  +         if (debug)
  +            log.debug("gc thread waited for pools");
   
            // Figure out how long to sleep
            long delay = getDelay();
  -         log.debug("gc thread delay: " + delay);
  -         
  +         if (debug)
  +            log.debug("gc thread delay: " + delay);
  +
            // Sleep
            if ( delay > 0l ) {
               try {
                  sleep( delay );
               } catch ( InterruptedException ignore ) {}
            }
  -         
  +
            // Run garbage collection on eligible pools
            runGC();
         }
  @@ -96,7 +100,7 @@
         if (debug) {
            log.debug("gc thread running gc");
         }
  -      
  +
         for ( Iterator it = pools.iterator(); it.hasNext();  ) {
            ObjectPool pool = ( ObjectPool )it.next();
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to