Skip to content

Commit f28c2c2

Browse files
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)
1 parent dd2e552 commit f28c2c2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Renci.SshNet/Channels/Channel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal abstract class Channel : IChannel
2222
private uint? _remoteWindowSize;
2323
private uint? _remoteChannelNumber;
2424
private uint? _remotePacketSize;
25-
private ISession _session;
25+
private readonly ISession _session;
2626
private bool _isDisposed;
2727

2828
/// <summary>
@@ -834,7 +834,6 @@ protected virtual void Dispose(bool disposing)
834834
var session = _session;
835835
if (session != null)
836836
{
837-
_session = null;
838837
session.ChannelWindowAdjustReceived -= OnChannelWindowAdjust;
839838
session.ChannelDataReceived -= OnChannelData;
840839
session.ChannelExtendedDataReceived -= OnChannelExtendedData;

0 commit comments

Comments
 (0)