Пример #1
0
        public void RequestCleanup()
        {
            CleanupSourceState state = this.State;

            if ((state & CleanupSourceState.CleanupNeeded) != CleanupSourceState.CleanupNeeded)
            {
                CleanupSourceState state2 = state | CleanupSourceState.CleanupNeeded;
                CleanupSourceState state3 = (CleanupSourceState)Interlocked.CompareExchange(ref this.state, (int)state2, (int)state);
                if ((state == state3) && CleanupThread.EnsureEnqueued(this))
                {
                    this.OnPerformCleanupQueued();
                }
            }
        }
Пример #2
0
 public static void WaitForPendingCleanup(int timeoutMs)
 {
     CleanupThread.WaitForPendingCleanup(timeoutMs);
 }