AutoResetEvent event = new AutoResetEvent(true); //Code to signal and wait the event event.Close();
AutoResetEvent event = new AutoResetEvent(false); //Code to wait the event event.Close();This example creates an AutoResetEvent instance and uses it to wait for an event. After the event is used, the Close() method is called to release all resources used by the instance. The package library for the csharp AutoResetEvent Close method is System.Threading.