22
1
using System;
2
using System.Threading;
3
public class MyThread
4
{
5
public static void Thread1()
6
{
7
for (int i = 0; i < 10; i++)
8
{
9
Console.WriteLine(i);
10
}
11
}
12
}
13
public class ThreadExample
14
{
15
public static void Main()
16
{
17
Thread t1 = new Thread(new ThreadStart(MyThread.Thread1));
18
Thread t2 = new Thread(new ThreadStart(MyThread.Thread1));
19
t1.Start();
20
t2.Start();
21
}
22
}
Cached Result
Lambda expression: 1234