Task a1 = Task.Factory.StartNew(() => t1()).ContinueWith(y=> t3());
static void t1()
{
Console.WriteLine("t1 -basla- ");
for (int i = 0; i < 10; i++)
{
Thread.Sleep(1000);
Console.WriteLine("t1 -" + i.ToString() + "-");
}
Console.WriteLine("t1 son");
}
static void t2()
{
Console.WriteLine("t2 -basla- ");
for (int i = 0; i < 10; i++)
{
Thread.Sleep(1000);
Console.WriteLine("t2 -" + i.ToString() + "-");
}
Console.WriteLine("t2 son");
}
static void t3()
{
Console.WriteLine("t3 -basla- ");
for (int i = 0; i < 10; i++)
{
Thread.Sleep(1000);
Console.WriteLine("t3 -" + i.ToString() + "-");
}
Console.WriteLine("t3 son");
}
Yorumlar
Yorum Gönder