mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Add missing lock to ensure thread-safe mutations of _activeInnerStreams in VirtualConnectionClient.cs
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user