Skip to content

Commit ee4f7ed

Browse files
Merge pull request #12434 from dotnet/main
Merge main into live
2 parents 66fd30d + 5c6ef28 commit ee4f7ed

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

xml/System.Threading/PeriodicTimer.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,14 @@ This timer is intended to be used only by a single consumer at a time: only one
208208
<Docs>
209209
<param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> for cancelling the asynchronous wait. If cancellation is requested, it affects only the single wait operation; the underlying timer continues firing.</param>
210210
<summary>Waits for the next tick of the timer, or for the timer to be stopped.</summary>
211-
<returns>A task that will be completed due to the timer firing, <see cref="M:System.Threading.PeriodicTimer.Dispose" /> being called to stop the timer, or cancellation being requested.</returns>
211+
<returns>A <see cref="T:System.Threading.Tasks.ValueTask`1" /> that will be completed due to the timer firing, <see cref="M:System.Threading.PeriodicTimer.Dispose" /> being called to stop the timer, or cancellation being requested.</returns>
212212
<remarks>
213-
<format type="text/markdown"><![CDATA[
214-
215-
## Remarks
216-
213+
<format type="text/markdown"><![CDATA[
214+
215+
## Remarks
216+
217+
The result of the returned <xref:System.Threading.Tasks.ValueTask%601> is `true` when it's completed due to the timer firing, and `false` when the timer is disposed. The returned <xref:System.Threading.Tasks.ValueTask%601> enters the Canceled state when cancellation is requested. If the <xref:System.Threading.CancellationToken> was already canceled when <xref:System.Threading.PeriodicTimer.WaitForNextTickAsync(System.Threading.CancellationToken)> was called, the returned <xref:System.Threading.Tasks.ValueTask%601> is created in the Canceled state.
218+
217219
The <xref:System.Threading.PeriodicTimer> behaves like an auto-reset event, in that multiple ticks are coalesced into a single tick if they occur between calls to <xref:System.Threading.PeriodicTimer.WaitForNextTickAsync(System.Threading.CancellationToken)>. Similarly, a call to <xref:System.Threading.PeriodicTimer.Dispose> will void any tick not yet consumed. <xref:System.Threading.PeriodicTimer.WaitForNextTickAsync(System.Threading.CancellationToken)> may only be used by one consumer at a time, and may be used concurrently with a single call to <xref:System.Threading.PeriodicTimer.Dispose>.
218220
219221

0 commit comments

Comments
 (0)