Author: ron.sigal(a)jboss.com
Date: 2008-03-17 03:47:12 -0400 (Mon, 17 Mar 2008)
New Revision: 3658
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java
Log:
JBREM-931: Updated SpinThread.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java 2008-03-17
07:46:10 UTC (rev 3657)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java 2008-03-17
07:47:12 UTC (rev 3658)
@@ -164,8 +164,8 @@
if (callbackHandler == null)
{
- log.info("sessionId: " + id);
- log.info("listeners: " + listeners);
+ log.debug("sessionId: " + id);
+ log.debug("listeners: " + listeners);
}
Callback callback = new Callback("callback");
for (int i = 0; i < callbacks; i++)
@@ -193,18 +193,30 @@
static class SpinThread extends Thread
{
boolean stop;
+ static int counter;
+ static Object lock = new Object();
+ public SpinThread()
+ {
+ synchronized (lock)
+ {
+ setName("spinThread:" + counter++);
+ }
+ }
public void setStop()
{
stop = true;
+ log.debug(this + " stop = " + stop);
}
public void run()
{
+ int n = 0;
while (!stop)
{
- int n = 2 + 2;
- n = n * n;
+ n++;
+ if ((n + 1) % 10000 == 0)
+ log.debug(this + "stop = " + stop);
}
log.debug("SpinThread done");
}
Show replies by date