Beispiel #1
0
        internal void Attach(RemoteCancellationTokenSource tokenSource)
        {
            Debug.Assert(RemotingServices.IsObjectOutOfAppDomain(tokenSource), "Attempt to unwrap remote token source inside the owning AppDomain");

            ImmutableInterlockedEx.Add(ref _TokenSources, tokenSource);

            // Cancel the remote token source if we're already cancelled
            // This will end up calling Detach, so do it at the end to ensure bookkeeping is consistent
            if (Token.IsCancellationRequested)
            {
                tokenSource.Cancel();
            }
        }
Beispiel #2
0
 internal void Detach(RemoteCancellationTokenSource tokenSource)
 {
     ImmutableInterlockedEx.Remove(ref _TokenSources, tokenSource);
 }