Partilhar via


ThreadingTools Class

Definition

Utility methods for working across threads.

public ref class ThreadingTools abstract sealed
public ref class ThreadingTools abstract sealed
class ThreadingTools abstract sealed
public static class ThreadingTools
type ThreadingTools = class
Public Module ThreadingTools
Inheritance
ThreadingTools

Methods

Apply(SynchronizationContext, Boolean)

Applies the specified SynchronizationContext to the caller's context.

ApplyChangeOptimistically<T,TArg>(T, TArg, Func<T,TArg,T>)

Optimistically performs some value transformation based on some field and tries to apply it back to the field, retrying as many times as necessary until no other thread is manipulating the same field.

ApplyChangeOptimistically<T>(T, Func<T,T>)

Optimistically performs some value transformation based on some field and tries to apply it back to the field, retrying as many times as necessary until no other thread is manipulating the same field.

WithCancellation(Task, CancellationToken)

Wraps a task with one that will complete as cancelled based on a cancellation token, allowing someone to await a task but be able to break out early by cancelling the token.

WithCancellation<T>(Task<T>, CancellationToken)

Wraps a task with one that will complete as cancelled based on a cancellation token, allowing someone to await a task but be able to break out early by cancelling the token.

Applies to

Thread Safety

This type is thread-safe for all members.