Esempio n. 1
0
        static void AddTimerWait(DecompilationCache dc)
        {
            Timer?timer    = null;
            var   weakSelf = new WeakReference(dc);

            timer = new Timer(a => {
                timer !.Dispose();
                if (weakSelf.Target is DecompilationCache self)
                {
                    self.ClearOld();
                    AddTimerWait(self);
                }
            }, null, Timeout.Infinite, Timeout.Infinite);
            timer.Change(CLEAR_OLD_ITEMS_EVERY_MS, Timeout.Infinite);
        }
Esempio n. 2
0
        static void AddTimerWait(DecompilationCache dc)
        {
            Timer timer    = null;
            var   weakSelf = new WeakReference(dc);

            timer = new Timer(a => {
                timer.Dispose();
                var self = (DecompilationCache)weakSelf.Target;
                if (self != null)
                {
                    self.ClearOld();
                    AddTimerWait(self);
                }
            }, null, CLEAR_OLD_ITEMS_EVERY_MS, Timeout.Infinite);
        }