We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02c7a55 commit b34fe4fCopy full SHA for b34fe4f
Singleton.Conceptual/ThreadSafe/Program.cs
@@ -74,17 +74,23 @@ static void Main(string[] args)
74
"RESULT:"
75
);
76
77
- Thread process1 = new Thread(() => {
+ Thread process1 = new Thread(() =>
78
+ {
79
TestSingleton("FOO");
80
});
- Thread process2 = new Thread(() => {
81
+ Thread process2 = new Thread(() =>
82
83
TestSingleton("BAR");
84
85
+
86
process1.Start();
87
process2.Start();
88
89
+ process1.Join();
90
+ process2.Join();
91
}
92
- static public void TestSingleton(string value)
93
+ public static void TestSingleton(string value)
94
{
95
Singleton singleton = Singleton.GetInstance(value);
96
Console.WriteLine(singleton.GetValue());
0 commit comments