Havret commented on pull request #59:
URL: https://github.com/apache/activemq-nms-amqp/pull/59#issuecomment-780505562


   Hi @brudo, what you're describing here could theoretically happen, when 
there is an await inside of a lock. In reality, the compiler prevents you from 
writing this kind of statement. It simply doesn't compile. You can give it a 
try. :) What we are dealing with here though is a slightly different situation. 
`TriggerReconnectionAttempt` is invoked inside of a lock in a fire and forget 
fashion. On the first await inside of it, it will simply return from the 
caller's perspective. The continuation will kick off on another thread, but the 
calling code will not be aware of that. This may cause some problems, but a 
deadlock is not one of them. 
   
   The solution that I proposed is a rather standard approach to 
synchronization/coordination when one needs to deal with asynchronous code.  


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to