On 01/16/2015 12:09 PM, Steve Rice wrote:
So if the thread wanting to shut down the Message Listening sets the message
listener to NULL, the setMessageListener call will not return until there is
no onMessage function in progress?

And so, after the setMessageListener(NULL) call returns, it is safe to
delete the MessageListener object?

Steve Rice



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/how-to-safely-delete-a-cms-MessageListener-object-tp4689939p4690057.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
.

That is correct, you can see this in the source of setMessageListener which locks on the listenerMutex which is held during onMessage calls to prevent the problem you are trying to avoid.

--
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.b...@redhat.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply via email to