I have problem when run code with Multiplethread after disconnect it's show some error like this.
This is my example code with error when disconnect and need help T-T
public void PluginRun()
{
Thread thread = new Thread(test);
Thread thread2 = new Thread(test2);
thread.Start();
thread2.Start();
while (true)
{
//bla bla bla
//.
//..
//...
}
}
private void test()
{
while (true)
{
Log("thread 1");
Thread.Sleep(1000);
}
}
private void test2()
{
while (true)
{
Log("thread 2");
Thread.Sleep(1000);
}
}
If anyone know how to fix this problem please show me some example I'm still beginner in programing, Thank you.

This is my example code with error when disconnect and need help T-T
public void PluginRun()
{
Thread thread = new Thread(test);
Thread thread2 = new Thread(test2);
thread.Start();
thread2.Start();
while (true)
{
//bla bla bla
//.
//..
//...
}
}
private void test()
{
while (true)
{
Log("thread 1");
Thread.Sleep(1000);
}
}
private void test2()
{
while (true)
{
Log("thread 2");
Thread.Sleep(1000);
}
}
If anyone know how to fix this problem please show me some example I'm still beginner in programing, Thank you.