-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing Time abstraction Part1 #83604
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Can you call out any places you made changes from the commit I gave you?
|
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Threading/PeriodicTimer.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs
Outdated
Show resolved
Hide resolved
@stephentoub I marked the places I changed as much as I can remember. Will be good to skim over the whole changes just in case spot something else. |
Thanks. FWIW, in such cases in the future you can start from the commit and just make changes in a new one. If you want to retrofit it, you can stash your changes, cherry-pick the commit, and then apply the changes on top of what's there (or a simple version of that just copy/paste your files on top of the ones from the cherry-pick). Regardless, knowing the diffs now will help me review, thanks. |
src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs
Outdated
Show resolved
Hide resolved
/// each time it's called. That capture can be suppressed with <see cref="ExecutionContext.SuppressFlow"/>. | ||
/// </para> | ||
/// </remarks> | ||
public abstract ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to consider some kind of out parameter that would allow this to communicate back whether all work has quiesced? Or are you thinking we'll investigate that as a follow-up? This is to allow, for example, CancellationTokenSource.TryReset to work with other timer implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have a follow up on that to see if there are any more things we need to consider. I'll create an issue for that.
#36617
This change is adding the time abstraction to the .NET 8.0. Next part is to support that for down-levels.