marcsaeg    01/10/26 07:18:01

  Modified:    src/share/org/apache/tomcat/net Tag: tomcat_32
                        ServerSocketFactory.java
  Log:
  Fixed a race condition in getDefault().
  
  PR:  4418
  Submitted by: [EMAIL PROTECTED]
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.2   +8 -11     
jakarta-tomcat/src/share/org/apache/tomcat/net/Attic/ServerSocketFactory.java
  
  Index: ServerSocketFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/net/Attic/ServerSocketFactory.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- ServerSocketFactory.java  2000/10/04 20:23:50     1.5.2.1
  +++ ServerSocketFactory.java  2001/10/26 14:18:00     1.5.2.2
  @@ -122,22 +122,19 @@
       /**
        * Returns a copy of the environment's default socket factory.
        */
  -    public static ServerSocketFactory getDefault () {
  +    public static synchronized ServerSocketFactory getDefault () {
           //
           // optimize typical case:  no synch needed
           //
   
           if (theFactory == null) {
  -            synchronized (ServerSocketFactory.class) {
  -                //
  -                // Different implementations of this method could
  -                // work rather differently.  For example, driving
  -                // this from a system property, or using a different
  -                // implementation than JavaSoft's.
  -                //
  -
  -                theFactory = new DefaultServerSocketFactory ();
  -            }
  +            //
  +            // Different implementations of this method could
  +            // work rather differently.  For example, driving
  +            // this from a system property, or using a different
  +            // implementation than JavaSoft's.
  +            //
  +            theFactory = new DefaultServerSocketFactory ();
           }
   
           try {
  
  
  


Reply via email to