Ejemplo n.º 1
0
        /// <summary>
        /// Gets the result value of the specified generic task.
        /// </summary>
#pragma warning disable CA1707  // Remove the underscores from member name
#pragma warning disable SA1300  // Element should begin with an uppercase letter
#pragma warning disable IDE1006 // Naming Styles
        public static TResult get_Result(ref SystemTasks.ValueTask <TResult> task)
        {
            var runtime = CoyoteRuntime.Current;

            if (runtime.SchedulingPolicy != SchedulingPolicy.None &&
                ValueTaskAwaiter.TryGetTask <TResult>(ref task, out SystemTasks.Task <TResult> innerTask))
            {
                runtime.WaitUntilTaskCompletes(innerTask);
            }

            return(task.Result);
        }