db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1094315 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Date Mon, 18 Apr 2011 07:26:53 GMT
Author: kahatlen
Date: Mon Apr 18 07:26:53 2011
New Revision: 1094315

URL: http://svn.apache.org/viewvc?rev=1094315&view=rev
Log:
DERBY-5192: Setting up network server for management tests hangs intermittently

Moved the waiting on the shutdown monitor in blockingStart() into a
while loop to ensure that it doesn't hang forever if the shutdown
signal comes before it's in the wait() call, and that it doesn't stop
waiting prematurely if it experiences a spurious wakeup.

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?rev=1094315&r1=1094314&r2=1094315&view=diff
==============================================================================
--- 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
Mon Apr 18 07:26:53 2011
@@ -803,7 +803,9 @@ public final class NetworkServerControlI
 			// wait until we are told to shutdown or someone sends an InterruptedException
 	        synchronized(shutdownSync) {
 	            try {
-					shutdownSync.wait();
+                    while (!shutdown) {
+                        shutdownSync.wait();
+                    }
 	            }
 	            catch (InterruptedException e)
 	            {
@@ -1196,8 +1198,8 @@ public final class NetworkServerControlI
 	*/
     void directShutdownInternal() {
 		// DERBY-2109: the direct, unchecked shutdown is made private
-		shutdown = true;
 		synchronized(shutdownSync) {						
+			shutdown = true;
 			// wake up the server thread
 			shutdownSync.notifyAll();
 		}



Mime
View raw message