AsyncLocal values not correct with TPL Dataflow
问题 Consider this example: class Program { private static readonly ITargetBlock<string> Mesh = CreateMesh(); private static readonly AsyncLocal<string> AsyncLocalContext = new AsyncLocal<string>(); static async Task Main(string[] args) { var tasks = Enumerable.Range(1, 4) .Select(ProcessMessage); await Task.WhenAll(tasks); Mesh.Complete(); await Mesh.Completion; Console.WriteLine(); Console.WriteLine("Done"); } private static async Task ProcessMessage(int number) { var param = number.ToString();