Csharp/C Sharp by API/System.Threading/AutoResetEvent

Материал из .Net Framework эксперт
Версия от 15:08, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

AutoResetEvent.WaitOne

<source lang="csharp"> using System; using System.Threading; // AutoReset class Auto {

   [STAThread]
   static void Main() {
       AutoResetEvent aRE = new AutoResetEvent(true);
       bool state = aRE.WaitOne(1000, true);
       Console.WriteLine("After First WaitOne " + state);
       state = aRE.WaitOne(5000, true);
       Console.WriteLine("After Second WaitOne " + state);
   }

}


 </source>