in localized/ja/10-Debugging/ParallelDebugging/Program.cs [58:78]
public static void Main(string[] args)
{
// Create a list of named threads. Random number as parameter means threads
// have different call stacks before hitting DoWorkFinal - better view for
// Parallel Stacks tool window
var random = new Random();
var threads = new List<Thread>();
for (var i = 0; i < 10; i++)
{
var thread = new Thread(DoWork)
{Name = $"MyThread_{i}"};
thread.Start(random.Next(100));
threads.Add(thread);
}
// Wait for the threads to finish
foreach (var thread in threads)
thread.Join();
Console.ReadLine();
}