Avoid capturing ExecutionContext into CancellationTokenSource's Timer by stephentoub · Pull Request #18670 · dotnet/coreclr (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you didn't make this internal for now and we can expose it later? why we need to have UnsafeCreate at all?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just following the proposed API, which maps to things like ThreadPool.QueueUserWorkItem vs ThreadPool.UnsafeQueueUserWorkItem. I don't have a strong preference.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am really preferring the constructor over UnsafeCreate. having flowExecutionContext parameter is more useful to understand.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.