This closes #1882
This commit is contained in:
commit
3823465e17
|
@ -170,6 +170,7 @@ public final class TimedBuffer extends CriticalComponentImpl {
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
enterCritical(CRITICAL_PATH_STOP);
|
enterCritical(CRITICAL_PATH_STOP);
|
||||||
|
Thread localTimer = null;
|
||||||
try {
|
try {
|
||||||
// add critical analyzer here.... <<<<
|
// add critical analyzer here.... <<<<
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
@ -190,16 +191,24 @@ public final class TimedBuffer extends CriticalComponentImpl {
|
||||||
logRatesTimerTask.cancel();
|
logRatesTimerTask.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (timerThread.isAlive()) {
|
localTimer = timerThread;
|
||||||
|
timerThread = null;
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
started = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (localTimer != null) {
|
||||||
|
while (localTimer.isAlive()) {
|
||||||
try {
|
try {
|
||||||
timerThread.join();
|
localTimer.join(1000);
|
||||||
|
if (localTimer.isAlive()) {
|
||||||
|
localTimer.interrupt();
|
||||||
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new ActiveMQInterruptedException(e);
|
throw new ActiveMQInterruptedException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
started = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
leaveCritical(CRITICAL_PATH_STOP);
|
leaveCritical(CRITICAL_PATH_STOP);
|
||||||
|
|
|
@ -68,7 +68,6 @@ public class CallbackOrderTest {
|
||||||
// We will repeat the test a few times, increasing N
|
// We will repeat the test a few times, increasing N
|
||||||
// to increase possibility of issues due to reuse of callbacks
|
// to increase possibility of issues due to reuse of callbacks
|
||||||
for (int n = 1; n < 100; n++) {
|
for (int n = 1; n < 100; n++) {
|
||||||
System.out.println("n = " + n);
|
|
||||||
int N = n;
|
int N = n;
|
||||||
count.set(0);
|
count.set(0);
|
||||||
list.clear();
|
list.clear();
|
||||||
|
|
|
@ -110,7 +110,7 @@ public class OpenWireManagementTest extends OpenWireTestBase {
|
||||||
|
|
||||||
|
|
||||||
String[] addresses = serverControl.getAddressNames();
|
String[] addresses = serverControl.getAddressNames();
|
||||||
assertEquals(3, addresses.length);
|
assertEquals(4, addresses.length);
|
||||||
for (String addr : addresses) {
|
for (String addr : addresses) {
|
||||||
assertFalse(addr.startsWith(AdvisorySupport.ADVISORY_TOPIC_PREFIX));
|
assertFalse(addr.startsWith(AdvisorySupport.ADVISORY_TOPIC_PREFIX));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue