[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/detection/jndi ...
Ron Sigal
ron_sigal at yahoo.com
Tue Nov 7 21:17:08 EST 2006
User: rsigal
Date: 06/11/07 21:17:08
Modified: src/tests/org/jboss/test/remoting/detection/jndi
RestartTestClient.java
Log:
JBREM-581: Added a flag to prevent a race in case notifyDetection() is called before waitOnDetection().
Revision Changes Path
1.4 +14 -4 JBossRemoting/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestClient.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RestartTestClient.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/detection/jndi/RestartTestClient.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- RestartTestClient.java 4 Nov 2006 04:29:06 -0000 1.3
+++ RestartTestClient.java 8 Nov 2006 02:17:08 -0000 1.4
@@ -60,6 +60,7 @@
protected int serversDetected;
protected boolean invocationSucceeded;
protected Object lock = new Object();
+ protected boolean notified;
/**
@@ -226,11 +227,20 @@
protected void waitOnDetection() throws InterruptedException
{
- log.info("entering waitOnDetection()");
synchronized (lock)
{
+ try
+ {
+ if (notified)
+ return;
+
lock.wait();
}
+ finally
+ {
+ notified = false;
+ }
+ }
}
@@ -238,6 +248,7 @@
{
synchronized (lock)
{
+ notified = true;
lock.notify();
}
}
@@ -260,7 +271,6 @@
log.info("The newly discovered server sent this response to our welcome message: " + response);
remotingClient.disconnect();
- log.info("client disconnected");
return;
}
More information about the jboss-cvs-commits
mailing list