mirror of https://github.com/apache/activemq.git
don't wait for ever to stop
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@585215 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9da7e31a33
commit
4c137cd2bc
|
@ -17,6 +17,7 @@
|
|||
package org.apache.activemq.perf;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.Connection;
|
||||
|
@ -62,7 +63,9 @@ public class PerfProducer implements Runnable {
|
|||
rate.reset();
|
||||
running = true;
|
||||
connection.start();
|
||||
new Thread(this).start();
|
||||
Thread t = new Thread(this);
|
||||
t.setName("Producer");
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,7 +73,7 @@ public class PerfProducer implements Runnable {
|
|||
synchronized (this) {
|
||||
running = false;
|
||||
}
|
||||
stopped.await();
|
||||
stopped.await(1,TimeUnit.SECONDS);
|
||||
connection.stop();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue