WaitHandle.Close Method

Definition

Releases all resources held by the current WaitHandle.

public virtual void Close ();

Remarks

This method is the public implementation of the IDisposable.Dispose method for the WaitHandle class and its derived classes. It provides a standard implementation that calls the Dispose(Boolean) overload with a true argument and then calls the GC.SuppressFinalize method. Call this method to release all resources held by an instance of WaitHandle or a derived class.

Once this method is called, references to the current instance cause undefined behavior.

Napomena

Always call Close or Dispose() before you release your last reference to the WaitHandle. Otherwise, the resources it is using will not be freed.

Notes to Inheritors

You should override the Dispose(Boolean) method to release resources allocated in derived classes.

Applies to

Proizvod Verzije
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also