Exemplo n.º 1
0
 static async ValueTask <T> SlowAwait(SingleThreadInvoker @this, ValueTask <T> valueTask)
 {
     try
     {
         return(await valueTask);
     }
     finally
     {
         @this.ReturnExecutionSlot();
     }
 }
Exemplo n.º 2
0
            static async ValueTask <T> SlowExecuteValueCall(SingleThreadInvoker @this, ICall <T> call)
            {
                await @this.WaitForExecutionSlot();

                try
                {
                    return(await call.Invoke());
                }
                finally
                {
                    @this.ReturnExecutionSlot();
                }
            }
Exemplo n.º 3
0
            static bool FastExecuteValueCall(SingleThreadInvoker @this, ICall <T> call, out ValueTask <T> valueTask)
            {
                try
                {
                    valueTask = call.Invoke();
                }
                catch
                {
                    @this.ReturnExecutionSlot();
                    throw;
                }

                return(valueTask.IsCompleted);
            }