Mono Class Library: System.GC Overview | Members

System.GC.WaitForPendingFinalizers Method

Suspends the current thread until the set of objects waiting for finalization is empty.

public static void WaitForPendingFinalizers ()

Remarks

GC.WaitForPendingFinalizers blocks an application until all objects that are awaiting finalization have been finalized.

When the garbage collector finds objects that can be reclaimed, it checks each object to determine the object's finalization requirements. If an object implements a finalizer and has not disabled finalization by calling GC.SuppressFinalize(object), the object is passed to the thread that handles finalization. The GC.WaitForPendingFinalizers method blocks until all finalizers have run to completion.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0