mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5535 - allow close state reporting w/o contention
This commit is contained in:
parent
c9c1f587ad
commit
de549f8926
|
@ -2550,6 +2550,10 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
protected Scheduler getScheduler() throws JMSException {
|
||||
Scheduler result = scheduler;
|
||||
if (result == null) {
|
||||
if (isClosing() || isClosed()) {
|
||||
// without lock contention report the closing state
|
||||
throw new ConnectionClosedException();
|
||||
}
|
||||
synchronized (this) {
|
||||
result = scheduler;
|
||||
if (result == null) {
|
||||
|
|
Loading…
Reference in New Issue