Mega Code Archive

 
Categories / C# by API / System Threading
 

ManualResetEvent Set

using System; using System.Threading; class ManualSet{     [STAThread]     static void Main(string[] args) {         ManualResetEvent manRE = new ManualResetEvent(false);         bool state = manRE.WaitOne(5000, true);         Console.WriteLine("ManualResetEvent After first WaitOne " + state);         manRE.Set();         state = manRE.WaitOne(5000, true);         Console.WriteLine("ManualResetEvent After second WaitOne " + state);     } }