You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
702 B
28 lines
702 B
using System;
|
|
using System.Threading;
|
|
|
|
namespace Sync_Ueb04_NestedMonitor
|
|
{
|
|
class TestNestedMonitor {
|
|
|
|
public static BlackHole blackhole = new BlackHole();
|
|
|
|
public static void Main()
|
|
{
|
|
Thread t1 = new Thread(delegate() {
|
|
Console.WriteLine(blackhole.Get().ToString());
|
|
});
|
|
|
|
Thread t2 = new Thread(delegate() {
|
|
blackhole.Put("Sonne, Licht, irgendetwas...");
|
|
});
|
|
|
|
Console.WriteLine("Wir starten die Untersuchung...");
|
|
t1.Start();
|
|
t2.Start();
|
|
t1.Join();
|
|
t2.Join();
|
|
Console.WriteLine("Was ist passiert...");
|
|
}
|
|
}
|
|
}
|
|
|