Add locking in ShellStream Read function

This commit is contained in:
olegkap_cp
2012-12-21 13:52:31 +00:00
parent 9dbd001bad
commit 58c0a23fa9
+5 -2
View File
@@ -163,9 +163,12 @@ namespace Renci.SshNet
{
var i = 0;
for (; i < count && this._incoming.Count > 0; i++)
lock (this._incoming)
{
buffer[offset + i] = this._incoming.Dequeue();
for (; i < count && this._incoming.Count > 0; i++)
{
buffer[offset + i] = this._incoming.Dequeue();
}
}
return i;