Przeglądaj źródła

Fix for channel session semaphore from thread blocking (#1071)

* Merging fix from @clivetong into our own SSH.NET fork
- The following article describes some of the issues with the double check lock that we have seen issues with: https://www.sudhanshutheone.com/posts/double-check-lock-csharp

* Merging fix from @clivetong into our own SSH.NET fork
- The following article describes some of the issues with the double check lock that we have seen issues with: https://www.sudhanshutheone.com/posts/double-check-lock-csharp

* Update Channel to fix AppVeyor failure (field should be readonly)
Patrick Yates 2 lat temu
rodzic
commit
f28c2c2dd0
1 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 2
      src/Renci.SshNet/Channels/Channel.cs

+ 1 - 2
src/Renci.SshNet/Channels/Channel.cs

@@ -22,7 +22,7 @@ namespace Renci.SshNet.Channels
         private uint? _remoteWindowSize;
         private uint? _remoteChannelNumber;
         private uint? _remotePacketSize;
-        private ISession _session;
+        private readonly ISession _session;
         private bool _isDisposed;
 
         /// <summary>
@@ -834,7 +834,6 @@ namespace Renci.SshNet.Channels
                 var session = _session;
                 if (session != null)
                 {
-                    _session = null;
                     session.ChannelWindowAdjustReceived -= OnChannelWindowAdjust;
                     session.ChannelDataReceived -= OnChannelData;
                     session.ChannelExtendedDataReceived -= OnChannelExtendedData;