Author: clebert.suconic(a)jboss.com
Date: 2011-03-01 09:08:34 -0500 (Tue, 01 Mar 2011)
New Revision: 10274
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
Log:
tweak on Discovery
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-03-01
08:26:18 UTC (rev 10273)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2011-03-01
14:08:34 UTC (rev 10274)
@@ -177,23 +177,19 @@
waitLock.notify();
}
- globalThreadPool.execute(new Runnable()
+ try
{
- public void run()
+ thread.interrupt();
+ thread.join(10000);
+ if(thread.isAlive())
{
- try
- {
- thread.interrupt();
- thread.join();
- }
- catch (InterruptedException e)
- {
- }
+ log.warn("Timed out waiting to stop discovery thread");
}
- });
+ }
+ catch (InterruptedException e)
+ {
+ }
- waitForRunnablesToComplete();
-
socket.close();
socket = null;
@@ -446,18 +442,4 @@
return changed;
}
- private void waitForRunnablesToComplete()
- {
- // Wait for any create objects runnable to complete
- Future future = new Future();
-
- globalThreadPool.execute(future);
-
- boolean ok = future.await(10000);
-
- if (!ok)
- {
- log.warn("Timed out waiting to stop discovery thread");
- }
- }
}
Show replies by date