示例#1
0
        /// <summary>
        /// Schedule 'callback' to be called in the next GC.  If the callback returns true it is
        /// rescheduled for the next Gen 2 GC.  Otherwise the callbacks stop.
        ///
        /// NOTE: This callback will be kept alive until either the callback function returns false,
        /// or the target object dies.
        /// </summary>
        public static void Register(Func <object, bool> callback, object targetObj)
        {
            // Create a unreachable object that remembers the callback function and target object.
            Gen2GcCallback gcCallback = new Gen2GcCallback();

            gcCallback.Setup(callback, targetObj);
        }
        // Token: 0x06003BB7 RID: 15287 RVA: 0x000E1148 File Offset: 0x000DF348
        public static void Register(Func <object, bool> callback, object targetObj)
        {
            Gen2GcCallback gen2GcCallback = new Gen2GcCallback();

            gen2GcCallback.Setup(callback, targetObj);
        }