public static Task <TResult> Run <TResult>(Func <Task <TResult> > function, CancellationToken cancellationToken) { if (CoyoteRuntime.IsExecutionControlled) { var runtime = CoyoteRuntime.Current; var task = runtime.ScheduleFunction(function, null, cancellationToken); return(runtime.UnwrapTask(task)); } return(Task.Run(FuzzingProvider.CreateFunc(function), cancellationToken)); }
public static Task <TResult> Run <TResult>(Func <TResult> function, CancellationToken cancellationToken) => CoyoteRuntime.IsExecutionControlled ? CoyoteRuntime.Current.ScheduleFunction(function, null, cancellationToken) : Task.Run(FuzzingProvider.CreateFunc(function), cancellationToken);