195 if (callback !=
null)
259 System.
Net.
NetEventSource.
Info(
this,
$"TimerThreadTimer#{base.StartTime}::Fire() Not firing ({base.StartTime} <= {tickCount} < {base.Expiration})",
"Fire");
270 System.
Net.
NetEventSource.
Info(
this,
$"TimerThreadTimer#{base.StartTime}::Fire() Firing ({base.StartTime} <= {tickCount} >= " +
base.Expiration +
")",
"Fire");
288 callback(
this, tickCount, context);
375 for (
int i = 0; i <
list.Count; i++)
392 thread.IsBackground =
true;
393 thread.Name =
".NET Network Timer";
static byte Min(byte val1, byte val2)
static bool IsFatal(Exception exception)
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
override Timer CreateTimer(Callback callback, object context)
readonly int _durationMilliseconds
Queue(int durationMilliseconds)
Timer CreateTimer(Callback callback, object context)
readonly object _queueLock
TimerNode(Callback callback, object context, int durationMilliseconds, object queueLock)
bool Fire(out int nextExpiration)
readonly TimerNode _timers
override Timer CreateTimer(Callback callback, object context)
TimerQueue(int durationMilliseconds)
readonly int _startTimeMilliseconds
Timer(int durationMilliseconds)
readonly int _durationMilliseconds
static readonly AutoResetEvent s_threadReadyEvent
delegate void Callback(Timer timer, int timeNoticed, object context)
static readonly Hashtable s_queuesCache
static readonly LinkedList< WeakReference > s_queues
static int s_cacheScanIteration
static Queue GetOrCreateQueue(int durationMilliseconds)
static bool IsTickBetween(int start, int end, int comparand)
static readonly LinkedList< WeakReference > s_newQueues
static readonly WaitHandle[] s_threadEvents
static readonly ManualResetEvent s_threadShutdownEvent
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)
static void Sleep(int millisecondsTimeout)
static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout)
static readonly IntPtr Zero
static GCHandle Alloc(object? value)