private static void Execute(Printers printers) { while (true) { printers.Print(Thread.CurrentThread.Name); Thread.Sleep(100); } }
public static void Run() { var printers = new Printers(); for (int i = 0; i < 10; i++) { var thread = new Thread(() => Execute(printers)); thread.Name = $"Thread #{i}"; thread.Start(); } }