Skip to content

Commit e1cee37

Browse files
stephentoubRon Petrusha
authored andcommitted
Add missing ThreadPool and Timer docs (#2758)
* Add missing ThreadPool and Timer docs * Apply suggestions from code review Co-Authored-By: Ron Petrusha <[email protected]> Co-Authored-By: Carlos Sanchez Lopez <[email protected]> * Added exceptions. * fix broken link
1 parent 503d60d commit e1cee37

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

xml/System.Threading/ThreadPool.xml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ If a thread pool implementation may have different types of work items, the coun
669669
<typeparam name="TState">The type of elements of <paramref name="state" />.</typeparam>
670670
<param name="callBack">An <see cref="T:System.Action`1" /> representing the method to execute.</param>
671671
<param name="state">An object containing data to be used by the method.</param>
672-
<param name="preferLocal">Unlike other QueueUserWorkItem methods, prefer executing in the local thread pool and not the global thread pool.</param>
672+
<param name="preferLocal"><see langword="true" /> to prefer queueing the work item in a queue close to the current thread; <see langword="false" /> to prefer queueing the work item to the thread pool's shared queue.</param>
673673
<summary>Queues a method specified by an <see cref="T:System.Action`1" /> delegate for execution, and provides data to be used by the method. The method executes when a thread pool thread becomes available.</summary>
674674
<returns>
675675
<see langword="true" /> if the method is successfully queued; <see cref="T:System.NotSupportedException" /> is thrown if the work item could not be queued.
@@ -1285,11 +1285,22 @@ If a thread pool implementation may have different types of threads, the count i
12851285
<Parameter Name="preferLocal" Type="System.Boolean" Index="1" FrameworkAlternate="netcore-3.0" />
12861286
</Parameters>
12871287
<Docs>
1288-
<param name="callBack">To be added.</param>
1289-
<param name="preferLocal">To be added.</param>
1290-
<summary>To be added.</summary>
1291-
<returns>To be added.</returns>
1292-
<remarks>To be added.</remarks>
1288+
<param name="callBack">The work item to invoke when a thread in the thread pool picks up the work item.</param>
1289+
<param name="preferLocal"><see langword="true" /> to prefer queueing the work item in a queue close to the current thread; <see langword="false" /> to prefer queueing the work item to the thread pool's shared queue.</param>
1290+
<summary>Queues the specified work item object to the thread pool.</summary>
1291+
<returns><see langword="true" /> if the method succeeds; <see cref="T:System.OutOfMemoryException" /> is thrown if the work item could not be queued.</returns>
1292+
<remarks>
1293+
<format type="text/markdown"><![CDATA[
1294+
1295+
## Remarks
1296+
1297+
The thread pool will invoke the work item's <xref:System.Threading.IThreadPoolWorkItem.Execute> method. It is the responsibility of that work item to propagate <xref:System.Threading.ExecutionContext> if it's needed; the thread pool will not do so.
1298+
1299+
]]></format>
1300+
</remarks>
1301+
<exception cref="T:System.ArgumentNullException"><paramref name="callback" /> is <see langword="null" />.</exception>
1302+
<exception cref="T:System.ArgumentOutOfRangeException">The work item is a <see cref="T:System.Threading.Tasks.Task" />.</exception>
1303+
<exception cref="T:System.OutOfMemoryException">The work item could not be queued.</exception>
12931304
</Docs>
12941305
</Member>
12951306
<Member MemberName="UnsafeQueueUserWorkItem">
@@ -1388,11 +1399,13 @@ If a thread pool implementation may have different types of threads, the count i
13881399
<typeparam name="TState">The type of elements of <paramref name="state" />.</typeparam>
13891400
<param name="callBack">A delegate representing the method to execute.</param>
13901401
<param name="state">An object containing data to be used by the method.</param>
1391-
<param name="preferLocal">`true` to execute in the local threadpool; `false` to execute in the global thread pool.</param>
1402+
<param name="preferLocal"><see langword="true" /> to prefer queueing the work item in a queue close to the current thread; <see langword="false" /> to prefer queueing the work item to the thread pool's shared queue.</param>
13921403
<summary>Queues a method specified by an <see cref="T:System.Action`1" /> delegate for execution, and specifies an object containing data to be used by the method. The method executes when a thread pool thread becomes available.</summary>
13931404
<returns>
13941405
<see langword="true" /> if the method is successfully queued; <see cref="T:System.NotSupportedException" /> is thrown if the work item could not be queued.</returns>
13951406
<remarks>To be added.</remarks>
1407+
<exception cref="T:System.ArgumentNullException"><paramref name="callback" /> is <see langword="null" />.</exception>
1408+
<exception cref="T:System.NotSupportedException">The work item could not be queued.</exception>
13961409
</Docs>
13971410
</Member>
13981411
<MemberGroup MemberName="UnsafeRegisterWaitForSingleObject">

xml/System.Threading/Timer.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,8 @@ Sub TimerCallback(state As Object)
895895
</ReturnValue>
896896
<Parameters />
897897
<Docs>
898-
<summary>To be added.</summary>
899-
<returns>To be added.</returns>
898+
<summary>Releases all resources used by the current instance of <see cref="T:System.Threading.Timer" />.</summary>
899+
<returns>A <see cref="T:System.Threading.Tasks.ValueTask" /> that completes when all work associated with the timer has ceased.</returns>
900900
<remarks>To be added.</remarks>
901901
</Docs>
902902
</Member>

0 commit comments

Comments
 (0)