Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.ServiceModel / System / ServiceModel / Channels / SharedConnectionListener.cs
index 6a655ad266561eff9191816884d072c923b19a61..81daac4299465bd3d4ee1ce9d955a665addaec9d 100644 (file)
@@ -778,22 +778,20 @@ namespace System.ServiceModel.Channels
                     CompletedAsyncResult<bool>.End(completedResult);
                 }
 
-                using (LockHelper.TakeReaderLock(this.readerWriterLock))
+                bool isClosed = !closed;
+                try
                 {
-                    try
+                    return ValidateUriRouteAsyncResult.End(result);
+                }
+                catch (Exception exception)
+                {
+                    if (Fx.IsFatal(exception) || !isClosed)
                     {
-                        return ValidateUriRouteAsyncResult.End(result);
+                        throw;
                     }
-                    catch (Exception exception)
-                    {
-                        if (Fx.IsFatal(exception) || !closed)
-                        {
-                            throw;
-                        }
 
-                        DiagnosticUtility.TraceHandledException(exception, TraceEventType.Error);
-                        return false;
-                    }                    
+                    DiagnosticUtility.TraceHandledException(exception, TraceEventType.Error);
+                    return false;
                 }
             }