Table of Contents

ICancellationTokenSource.CancelAfter Method

Requests cancellation once ATimeoutMs milliseconds have passed.

Remarks

Calling it again restarts the countdown with the new value. INFINITE disarms it, and zero cancels immediately. The countdown fires on a shared background thread, where callbacks registered on the token then run; an exception raised by one of them is discarded.

Releasing the source does not disarm the countdown: it belongs to the token, and lasts as long as the token is referenced.

Syntax

Unit: Bcl.Cancellation

procedure ICancellationTokenSource.CancelAfter(ATimeoutMs: Cardinal); virtual; abstract;

Parameters

<-> Parameter Type Description
ATimeoutMs Cardinal

See also