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)
This commit is contained in:
Patrick Yates
2023-09-28 20:01:18 +01:00
committed by GitHub
parent dd2e55209b
commit f28c2c2dd0
+1 -2
View File
@@ -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;