You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mm...@locus.apache.org on 2000/09/27 23:38:33 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/stree Parent.java

mmidy       00/09/27 14:38:31

  Modified:    java/src/org/apache/xalan/stree Parent.java
  Log:
  Use hasChildNode instead of getChildCount in getFirstChild. Better for MultiThreading.
  
  Revision  Changes    Path
  1.6       +7 -3      xml-xalan/java/src/org/apache/xalan/stree/Parent.java
  
  Index: Parent.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/Parent.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Parent.java	2000/08/11 23:54:57	1.5
  +++ Parent.java	2000/09/27 21:38:28	1.6
  @@ -37,7 +37,7 @@
         {
           try
           {
  -          //System.out.println("Waiting... getCount " );
  +          //System.out.println("Waiting... getCount "+ this.getNodeName() );
             wait();
           }
           catch (InterruptedException e)
  @@ -48,6 +48,7 @@
           
         }
       }
  +    //System.out.println("Waiting... Done "+ this.getNodeName() );          
       return (null == m_children) ? 0 : m_children.length;
     }
     
  @@ -64,7 +65,7 @@
         {
           try
           {
  -          //System.out.println("Waiting... getCount " );
  +          //System.out.println("Waiting... getCount " + this.getNodeName() );
             wait();
           }
           catch (InterruptedException e)
  @@ -74,6 +75,7 @@
           //System.out.println("... getcount " );        
         }
       }
  +    //System.out.println("Waiting(haschildnodes)... Done "+ this.getNodeName() );
       return (null == m_children || m_children.length == 0) ? false : true;
  }
     
     /**
  @@ -107,6 +109,7 @@
           try
           {
             // System.out.println("Waiting... getChild " + i + " " + getNodeName());
  +          
             wait();
           }
           catch (InterruptedException e)
  @@ -128,7 +131,7 @@
      */
     public Node         getFirstChild()
     {
  -    if (getChildCount() == 0)
  +    if (!hasChildNodes())
         return null;
       else        
      return getChild(0);
     }
  
  @@ -270,6 +273,7 @@
         // Notify anyone waiting for a child...
         synchronized (this)
         {
  +        //System.out.println("notify set complete" + this.getNodeName());
           notifyAll();
         }
       }