jdk/src/share/classes/sun/security/ssl/Handshaker.java
changeset 100 01ef29ca378f
parent 2 90ce3da70b43
child 715 f16baef3a20e
--- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java	Sun Mar 16 23:46:27 2008 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java	Mon Mar 17 03:11:29 2008 -0400
@@ -617,7 +617,8 @@
         r.write(1);     // single byte of data
 
         if (conn != null) {
-            synchronized (conn.writeLock) {
+            conn.writeLock.lock();
+            try {
                 conn.writeRecord(r);
                 conn.changeWriteCiphers();
                 if (debug != null && Debug.isOn("handshake")) {
@@ -625,6 +626,8 @@
                 }
                 mesg.write(output);
                 output.flush();
+            } finally {
+                conn.writeLock.unlock();
             }
         } else {
             synchronized (engine.writeLock) {