-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Threading
Milestone
Description
Today to run code on a specific ExecutionContext, there's a non-generic Run method that takes a ContextCallback and object state. We should add a generic overload to boxing can be avoided (for e.g. when passing a ValueTuple):
namespace System.Threading
{
public sealed class ExecutionContext
{
// New
public static void Run<TState>(ExecutionContext context, ContextCallback<TState> callback, ref TState state);
// Existing
public static void Run(ExecutionContext executionContext, ContextCallback callback, object? state);
...
}
// New (it exists but as internal)
public delegate void ContextCallback<TState>(ref TState state);
// Existing
public delegate void ContextCallback(object? state);
}Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Threading