Author: chirino Date: Wed Nov 29 23:19:19 2006 New Revision: 480862 URL: http://svn.apache.org/viewvc?view=rev&rev=480862 Log: https://issues.apache.org/activemq/browse/AMQ-1078
Modified: incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java Modified: incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java?view=diff&rev=480862&r1=480861&r2=480862 ============================================================================== --- incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java (original) +++ incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java Wed Nov 29 23:19:19 2006 @@ -63,8 +63,11 @@ public void wakeup() { if( !dispatchedBySessionPool ) { - if( taskRunner!=null ) { + if( session.isSessionAsyncDispatch() ) { try { + if( taskRunner == null ) { + taskRunner = session.connection.getSessionTaskRunner().createTaskRunner(this, "ActiveMQ Session: "+session.getSessionId()); + } taskRunner.wakeup(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); @@ -101,10 +104,8 @@ synchronized void start() { if( !messageQueue.isRunning() ) { messageQueue.start(); - if( session.isSessionAsyncDispatch() || dispatchedBySessionPool ) { - taskRunner = session.connection.getSessionTaskRunner().createTaskRunner(this, "ActiveMQ Session: "+session.getSessionId()); - } - wakeup(); + if( hasUncomsumedMessages() ) + wakeup(); } }