Havret edited a comment on pull request #59:
URL: https://github.com/apache/activemq-nms-amqp/pull/59#issuecomment-780898935


   @brudo Please take a look at the following snippet:
   
   ```
       class Program
       {
           private static object syncRoot = new object();
           
           static async Task Main(string[] args)
           {
               lock (syncRoot)
               {
                   Console.WriteLine("Before not awaited");    
                   NotWaitedMethod();
                   Console.WriteLine("After not awaited");
               }
   
               await Task.Delay(TimeSpan.FromSeconds(2));
           }
   
           private static async Task NotWaitedMethod()
           {
               Console.WriteLine("Inside before await");
               await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
               Console.WriteLine("Inside after await");
           }
       }
   ```
   
   The output will look as follows: 
   ```
   Before not awaited
   Inside before await
   After not awaited
   Inside after await
   ```


----------------------------------------------------------------
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