public void Yield()
 {
     if (MyThread.Store(0) == 0)
     {
         MainThread.Restore(1);
     }
 }