Skip to content

Commit

Permalink
Update src/Adapter/PlatformServices.Shared/netstandard1.3/Services/ns…
Browse files Browse the repository at this point in the history
…13ThreadSafeStringWriter.cs

Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
  • Loading branch information
nohwnd and Evangelink authored Apr 14, 2022
1 parent bc1f8e6 commit f9f089c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ThreadSafeStringWriter : StringWriter
private static readonly AsyncLocal<Dictionary<string, ThreadSafeStringBuilder>> State = new AsyncLocal<Dictionary<string, ThreadSafeStringBuilder>>();

// This static lock guards access to the state and getting values from dictionary. There can be multiple different instances of ThreadSafeStringWriter
// acessing the state at the same time, and we need to give them the correct state for their async context. Non-concurrect dictionary is used to store the
// accessing the state at the same time, and we need to give them the correct state for their async context. Non-concurrent dictionary is used to store the
// state because we need to lock around it anyway, to ensure that the State is populated, but not overwritten by every new instance of ThreadSafeStringWriter.
private static readonly object StaticLockObject = new object();
private readonly string outputType;
Expand Down

0 comments on commit f9f089c

Please # to comment.