Add missing lock to ensure thread-safe mutations of _activeInnerStreams in VirtualConnectionClient.cs
This commit is contained in:
parent
f2c30472f2
commit
3fc19ea77b
|
|
@ -46,7 +46,11 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels.VirtualConnections
|
||||||
|
|
||||||
var id = Interlocked.Increment(ref _nextInnerStreamId);
|
var id = Interlocked.Increment(ref _nextInnerStreamId);
|
||||||
var newInnerStream = new VirtualConnection(id, this);
|
var newInnerStream = new VirtualConnection(id, this);
|
||||||
_activeInnerStreams.Add(id, newInnerStream);
|
lock (_activeInnerStreams)
|
||||||
|
{
|
||||||
|
_activeInnerStreams.Add(id, newInnerStream);
|
||||||
|
}
|
||||||
|
|
||||||
return newInnerStream;
|
return newInnerStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue