Table of Contents

Enum TimerCallbackExecutionContext

Namespace
KZDev.SystemClock.PrimeTime
Assembly
KZDev.SystemClock.PrimeTime.dll

Controls whether timer callbacks capture and restore the calling execution context (for example SynchronizationContext and AsyncLocal<T>) or run without it (unsafe).

public enum TimerCallbackExecutionContext

Fields

Capture = 0

Capture the current execution context when the timer is registered and restore it when invoking the callback. This is the default so callbacks run in the same context as the registration site (same synchronization context, async locals, and so on).

Unsafe = 1

Do not capture execution context. Callbacks run without restoring the registration context (unsafe). Use when the callback does not depend on synchronization context or when avoiding context capture is desired for performance or isolation.