Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public PinnableObjectPool(Func <T> factory)
 {
     this.factory = factory;
     Gen2GcCallback.Register(Gen2GcCallbackFunc, this);
 }