Page 1 of 1

Ist diese C# -Programm-Thread-Sicherheit [Duplikat]

Posted: 04 Mar 2025, 07:16
by Anonymous
Dieser Beitrag unten habe ich gelesen, aber er hat nicht verwandt.

Code: Select all

namespace helloworld
{
internal class Program
{
static void Main()
{
int foo =0;

var t = new Thread(() =>
{
foo++;
} );
t.Start();
t.Join();
Console.WriteLine(foo);
}
}

}