@@ -26,7 +26,7 @@ item is not dequeued until any items on which it depends have been dequeued.
2626If one must ascribe a catchy initialism to such a queue, a nice one is WIRDO —
2727** w** hatever ** i** n, ** r** everse ** d** ependency ** o** ut.
2828
29- If an example would be helpful, skip to the Example section below.
29+ If an example would be helpful, skip to the [ Example] ( #example ) section below.
3030
3131### Creation
3232
@@ -148,7 +148,9 @@ call `Complete()` to inform the queue.
148148queue .Complete (entry );
149149```
150150
151- ` TryDequeue() ` , ` TryDequeueAsync() ` , and ` Complete() ` are thread-safe.
151+ ` TryDequeue() ` , ` TryDequeueAsync() ` , and ` Complete() ` are thread-safe. For
152+ full thread safety information, see the [ Thread Safety] ( #thread-safety ) section
153+ below.
152154
153155Because dequeueing and completing entries is often done in a loop and in
154156parallel, DependencyQueue provides ` Run() ` and ` RunAsync() ` methods that
@@ -200,8 +202,9 @@ await var entry = queue.TryDequeueAsync(
200202### Inspection
201203
202204To peek into a queue, the ` DependencyQueue<T> ` class provides the ` Inspect() `
203- method. The method acquires an exclusive lock on the queue and returns a
204- read-only view of the queue that holds the lock until the view is disposed.
205+ and ` InspectAsync() ` methods. These methods acquire an exclusive lock on the
206+ queue and return a read-only view of the queue. The view holds the exclusive
207+ lock until disposed.
205208
206209``` csharp
207210using var view = queue .Inspect ();
@@ -244,6 +247,8 @@ A `DependencyQueue<T>` instance has four possible states:
244247
245248### Thread Safety
246249
250+ Most methods of ` DependencyQueue<T> ` are thread-safe. Specifically:
251+
247252- The object returned by ` CreateEntryBuilder() ` is not thread-safe, but
248253 multiple threads can each use their own builder instance to enqueue items in
249254 parallel.
@@ -253,6 +258,9 @@ A `DependencyQueue<T>` instance has four possible states:
253258- All dequeue methods (` TryDequeue() ` , ` TryDequeueAsync() ` , ` Run() ` ,
254259 ` RunAsync() ` , and ` Complete() ` ) are thread-safe.
255260
261+ - All inspection methods (` Inspect() ` and ` InspectAsync() ` ) are thread-safe, as
262+ are the objects they return.
263+
256264- ` SetEnding() ` is thread-safe.
257265
258266- ` Dispose() ` is not thread-safe.
0 commit comments