[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/callback ...
Ron Sigal
ron_sigal at yahoo.com
Mon Nov 6 02:16:37 EST 2006
User: rsigal
Date: 06/11/06 02:16:37
Modified: src/main/org/jboss/remoting/callback CallbackPoller.java
Log:
JBREM-610: In thread shutdown() methods, call notify() to wake up waiting threads.
Revision Changes Path
1.6 +25 -1 JBossRemoting/src/main/org/jboss/remoting/callback/CallbackPoller.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CallbackPoller.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/callback/CallbackPoller.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- CallbackPoller.java 28 Oct 2006 19:15:20 -0000 1.5
+++ CallbackPoller.java 6 Nov 2006 07:16:37 -0000 1.6
@@ -110,7 +110,7 @@
}
}
- handleThread = new HandleThread();
+ handleThread = new HandleThread("HandleThread");
handleThread.start();
timer = new Timer(true);
@@ -172,6 +172,10 @@
boolean running = true;
Callback callback;
+ HandleThread(String name)
+ {
+ super(name);
+ }
public void run()
{
while (running)
@@ -190,6 +194,10 @@
continue;
}
}
+
+ if (!running)
+ return;
+
callback = (Callback) toHandleList.remove(0);
}
@@ -210,6 +218,10 @@
public void shutdown()
{
running = false;
+ synchronized (toHandleList)
+ {
+ toHandleList.notify();
+ }
}
}
@@ -219,6 +231,10 @@
Callback callback;
ArrayList callbacksCopy = new ArrayList();
+ AcknowledgeThread(String name)
+ {
+ super(name);
+ }
public void run()
{
while (running)
@@ -237,6 +253,10 @@
continue;
}
}
+
+ if (!running)
+ return;
+
callbacksCopy.addAll(toAcknowledgeList);
toAcknowledgeList.clear();
}
@@ -256,6 +276,10 @@
public void shutdown()
{
running = false;
+ synchronized (toAcknowledgeList)
+ {
+ toAcknowledgeList.notify();
+ }
}
}
More information about the jboss-cvs-commits
mailing list