private void button1_Click(object sender, RoutedEventArgs e)
{
Thread th1 = new Thread(new ThreadStart(GetNum));
Thread th2 = new Thread(new ThreadStart(GetNum));
th1.Start();
th2.Start();
textBlock1.Text = num.ToString();
}
private void GetNum()
{
lock{
for (int i = 0; i < 50; i++)
{
num++;
} } } }