63 for (
int i = 0; i <
tokens.Length; i++)
65 if (
tokens[i].CanBeCanceled)
116 node.Callback =
null;
117 node.CallbackState =
null;
118 node.ExecutionContext =
null;
119 node.SynchronizationContext =
null;
144 node.Prev.Next =
node.Next;
146 if (
node.Next !=
null)
148 node.Next.Prev =
node.Prev;
333 long num = (long)
delay.TotalMilliseconds;
375 long num = (long)
delay.TotalMilliseconds;
428 flag =
timer ==
null || (
timer.Change(uint.MaxValue, uint.MaxValue) && !
timer._everQueued);
506 callbackNode.Callback = callback;
526 callbackNode.Callback = callback;
595 callbacks.Next.Prev =
null;
597 registrations.Callbacks =
callbacks.Next;
598 registrations.ExecutingCallbackId =
callbacks.Id;
609 if (
callbacks.SynchronizationContext !=
null)
646 if (!
token2.CanBeCanceled)
670 return tokens.Length
switch
void Add(TKey key, TValue value)
static int CurrentManagedThreadId
static void SuppressFinalize(object obj)
static string CancellationToken_CreateLinkedToken_TokensIsEmpty
ExecutionContext ExecutionContext
SynchronizationContext SynchronizationContext
readonly Registrations Registrations
CallbackNode(Registrations registrations)
readonly CancellationTokenRegistration _reg1
Linked1CancellationTokenSource(CancellationToken token1)
override void Dispose(bool disposing)
readonly CancellationTokenRegistration _reg2
Linked2CancellationTokenSource(CancellationToken token1, CancellationToken token2)
override void Dispose(bool disposing)
readonly CancellationTokenRegistration _reg1
override void Dispose(bool disposing)
CancellationTokenRegistration[] _linkingRegistrations
LinkedNCancellationTokenSource(CancellationToken[] tokens)
static readonly Action< object > s_linkedTokenCancelDelegate
Registrations(CancellationTokenSource source)
volatile int ThreadIDExecutingCallbacks
ValueTask WaitForCallbackToCompleteAsync(long id)
CallbackNode FreeNodeList
bool Unregister(long id, CallbackNode node)
void Recycle(CallbackNode node)
void WaitForCallbackToComplete(long id)
readonly CancellationTokenSource Source
void InitializeWithTimer(uint millisecondsDelay)
static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token)
static readonly CancellationTokenSource s_canceledSource
void NotifyCancellation(bool throwOnFirstException)
static void Invoke(Delegate d, object state, CancellationTokenSource source)
CancellationTokenSource(int millisecondsDelay)
CancellationTokenSource(TimeSpan delay)
void CancelAfter(int millisecondsDelay)
void CancelAfter(uint millisecondsDelay)
static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token1, CancellationToken token2)
CancellationTokenRegistration Register(Delegate callback, object stateForCallback, SynchronizationContext syncContext, ExecutionContext executionContext)
CancellationTokenSource()
void CancelAfter(TimeSpan delay)
static void TimerCallback(object state)
volatile ManualResetEvent _kernelEvent
void ExecuteCallbackHandlers(bool throwOnFirstException)
static readonly TimerCallback s_timerCallback
void Cancel(bool throwOnFirstException)
Registrations _registrations
bool IsCancellationRequested
static readonly CancellationTokenSource s_neverCanceledSource
static CancellationTokenSource CreateLinkedTokenSource(params CancellationToken[] tokens)
volatile TimerQueueTimer _timer
virtual void Dispose(bool disposing)
bool IsCancellationCompleted
static void RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)
static TaskScheduler Default
static new TaskFactory< TResult > Factory
static bool Read(ref bool location)
static void Write(ref bool location, bool value)
static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
static void ThrowObjectDisposedException(ExceptionResource resource)
static CancellationToken None