Пример #1
0
 private void TestParkRunnable()
 {
     try
     {
         LockSupport.Park();
     }
     catch (Exception)
     {
         ThreadUnexpectedException();
     }
 }
Пример #2
0
 private void TestParkUntilRunnable()
 {
     try
     {
         LockSupport.ParkUntil(DateTime.Now.AddMilliseconds(100));
     }
     catch (Exception)
     {
         ThreadUnexpectedException();
     }
 }
Пример #3
0
 private void TestParkRunnable2()
 {
     try
     {
         Thread.Sleep(SHORT_DELAY_MS);
         LockSupport.Park();
     }
     catch (Exception)
     {
         ThreadUnexpectedException();
     }
 }
Пример #4
0
 private void TestParkRunnable4()
 {
     try
     {
         Thread.SpinWait(200);
         LockSupport.Park();
     }
     catch (Exception e)
     {
         ThreadUnexpectedException(e);
     }
 }
Пример #5
0
        public void TestPark2()
        {
            Thread t = new Thread(TestParkRunnable2);

            try
            {
                t.Start();
                LockSupport.UnPark(t);
                t.Join();
            }
            catch (Exception e)
            {
                UnexpectedException(e);
            }
        }
Пример #6
0
        public void TestPark()
        {
            Thread t = new Thread(TestParkRunnable);

            try
            {
                t.Start();
                Thread.Sleep(SHORT_DELAY_MS);
                LockSupport.UnPark(t);
                t.Join();
            }
            catch (Exception e)
            {
                UnexpectedException(e);
            }
        }