Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 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);