* java/io/BufferedWriter.java (localFlush): Don't synchronize.
authorTom Tromey <tromey@redhat.com>
Tue, 23 Oct 2001 16:18:44 +0000 (16:18 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Tue, 23 Oct 2001 16:18:44 +0000 (16:18 +0000)
From-SVN: r46435

libjava/ChangeLog
libjava/java/io/BufferedWriter.java

index bdd60919c1ee6e40a7865119775f3b8bb675149d..ba19fca58e6e8675e775ec3e5d208dcf8927ecbb 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-23  Tom Tromey  <tromey@redhat.com>
+
+       * java/io/BufferedWriter.java (localFlush): Don't synchronize.
+
 2001-10-23  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
 
        * prims.cc (_Jv_Abort): Always print error message using fprintf,
index 371c496c7c3798dd03abf2425d0bcdfb97bb7224..732f7bb471812402220f23b9f9d63c86e5a5cc6b 100644 (file)
@@ -216,15 +216,13 @@ public class BufferedWriter extends Writer
       }
   }
 
+  // This should only be called with the lock held.
   private final void localFlush () throws IOException
   {
     if (count > 0)
       {
-       synchronized (lock)
-         {
-           out.write(buffer, 0, count);
-           count = 0;
-         }
+       out.write(buffer, 0, count);
+       count = 0;
       }
   }