GC.CancelFullGCNotification 方法

定义

取消注册垃圾回收通知。Cancels the registration of a garbage collection notification.

public:
 static void CancelFullGCNotification();
[System.Security.SecurityCritical]
public static void CancelFullGCNotification ();
static member CancelFullGCNotification : unit -> unit
Public Shared Sub CancelFullGCNotification ()
属性

异常

此成员在启用并发垃圾回收时不可用。This member is not available when concurrent garbage collection is enabled. 若要了解如何禁用并发垃圾回收,请参阅 <gcConcurrent> 运行时设置。See the <gcConcurrent> runtime setting for information about how to disable concurrent garbage collection.

示例

下面的示例取消垃圾回收的注册。The following example cancels a garbage collection registration. 此示例摘自为垃圾回收通知主题提供的更大示例。This example is part of a larger example provided for the Garbage Collection Notifications topic.

finalExit = true;
checkForNotify = false;
GC::CancelFullGCNotification();
finalExit = true;
checkForNotify = false;
GC.CancelFullGCNotification();
finalExit = True
checkForNotify = False
GC.CancelFullGCNotification()

注解

此方法取消使用 RegisterForFullGCNotification 方法注册的垃圾回收通知。This method cancels a garbage collection notification that was registered by using the RegisterForFullGCNotification method. 在对 RegisterForFullGCNotification 方法的后续调用中调整阈值参数值之前,不必调用此方法。You do not have to call this method before adjusting threshold parameter values in subsequent calls to the RegisterForFullGCNotification method.

安全性

LinkDemand
完全信任直接调用方。for full trust for the immediate caller. 部分信任的程式碼無法使用此成員。This member cannot be used by partially trusted code.

SecurityCriticalAttribute
需要对直接调用方的完全信任。requires full trust for the immediate caller. 部分受信任的或透明的代码不能使用此成员。This member cannot be used by partially trusted or transparent code.

适用于

另请参阅