How interrupt thread child in this case? I need interrupt foreach in thread child after throw exception in thread parent
Thread child;
Thread parent = new Thread(() =>
{
child = new Thread(() =>
{
for (int i = 0; i < int.MaxValue; i++)
{
Console.WriteLine("THREAD 1 = " + i);
}
});
child.Start();
try
{
child.Join();
}
catch (Exception ex)
{
System.Console.WriteLine(ex.ToString());
** // here????**
}
});
parent.Start();
parent.Interrupt();
Interrupt thread child