InOrderThreadPoolQueue Class
Represents work items that are run serially on threadpool threads.
Namespace: Microsoft.WindowsServerSolutions.Common.ProviderFramework
Assembly: ProviderFramework (in ProviderFramework.dll)
Inheritance Hierarchy
System.Object
Microsoft.WindowsServerSolutions.Common.ProviderFramework.InOrderThreadPoolQueue
Syntax
public sealed class InOrderThreadPoolQueue : IDisposable
public ref class InOrderThreadPoolQueue sealed : IDisposable
Public NotInheritable Class InOrderThreadPoolQueue
Implements IDisposable
Constructors
Name | Description | |
---|---|---|
InOrderThreadPoolQueue() | Initializes a new instance of the InOrderThreadPoolQueue class. |
|
InOrderThreadPoolQueue(Action<Action>) | Initializes a new instance of the InOrderThreadPoolQueue class. |
Methods
Name | Description | |
---|---|---|
Dispose() | Releases all resources use by the InOrderThreadPoolQueue object. |
|
Equals(Object) | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
QueueAction(Action) | Queues a work item to the InOrderThreadPoolQueue. |
|
QueueHighPriorityAction(Action) | Queues a work item to the InOrderThreadPoolQueue at high priority. |
|
ToString() | (Inherited from Object.) |
Remarks
You should use this class instead of ThreadPool.QueueUserWorkItem directly because the work items that you enqueue to an instance of InOrderThreadPoolQueue are run in the order that they were queued. This is useful if you want to use the ThreadPool to work asynchronously, but order is important. For example, if you queue two work items, A and B, work item B will not start until work item A has finished.
Disposing of an InOrderThreadPoolQueue object cancels any work items that have not run, but a work item that has already started cannot be stopped.
Thread Safety
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.WindowsServerSolutions.Common.ProviderFramework Namespace
Return to top