db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r549412 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Date Thu, 21 Jun 2007 07:13:17 GMT
Author: kahatlen
Date: Thu Jun 21 00:13:17 2007
New Revision: 549412

URL: http://svn.apache.org/viewvc?view=rev&rev=549412
Log:
DERBY-1573: Unsafe synchronization in NetworkServerControlImpl

Contributed by Thomas Nielsen.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?view=diff&rev=549412&r1=549411&r2=549412
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Thu Jun 21 00:13:17 2007
@@ -513,10 +513,11 @@
 	public void consoleExceptionPrintTrace(Throwable e)
 	{
 		consoleMessage(e.getMessage());
-		if (logWriter != null)
+		PrintWriter lw = logWriter;
+		if (lw != null)
 		{
-			synchronized (logWriter) {
-				e.printStackTrace(logWriter);
+			synchronized (lw) {
+				e.printStackTrace(lw);
 			}
 		}
 		else
@@ -524,10 +525,11 @@
 			e.printStackTrace();
 		}
 		
-		if (cloudscapeLogWriter != null)
+		lw = cloudscapeLogWriter;
+		if (lw != null)
 		{
-			synchronized(cloudscapeLogWriter) {
-				e.printStackTrace(cloudscapeLogWriter);
+			synchronized(lw) {
+				e.printStackTrace(lw);
 			}
 		}
 	}
@@ -543,15 +545,17 @@
 	public void consoleMessage(String msg)
 	{
 		// print to console if we have one
-		if (logWriter != null)
+		PrintWriter lw = logWriter;
+		if (lw != null)
 		{
-			synchronized(logWriter) {
-				logWriter.println(msg);
+			synchronized(lw) {
+				lw.println(msg);
 			}
 		}
 		// always print to derby.log
-		if (cloudscapeLogWriter != null)
-			synchronized(cloudscapeLogWriter)
+		lw = cloudscapeLogWriter;
+		if (lw != null)
+			synchronized(lw)
 			{
 				Monitor.logMessage(msg);
 			}



Mime
View raw message