Beispiel #1
0
 public void run()
 {
     Console.WriteLine("own:: Thread started");
     sync.Capture();
     if (data.value == 0)
     {
         try
         {
             Console.WriteLine("own:: Waiting");
             sync.Wait();
             Console.WriteLine("own:: Running again");
         }
         catch (ThreadInterruptedException ex)
         {
             Console.WriteLine("own:: Interrupted: " + ex.Message);
         }
     }
     Console.WriteLine("own:: data.value = " + data.value);
     sync.Release();
 }