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
System_CAPS_pubmethod InOrderThreadPoolQueue()

Initializes a new instance of the InOrderThreadPoolQueue class.

System_CAPS_pubmethod InOrderThreadPoolQueue(Action<Action>)

Initializes a new instance of the InOrderThreadPoolQueue class.

Methods

Name Description
System_CAPS_pubmethod Dispose()

Releases all resources use by the InOrderThreadPoolQueue object.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod QueueAction(Action)

Queues a work item to the InOrderThreadPoolQueue.

System_CAPS_pubmethod QueueHighPriorityAction(Action)

Queues a work item to the InOrderThreadPoolQueue at high priority.

System_CAPS_pubmethod 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