static async ValueTask <T> SlowAwait(SingleThreadInvoker @this, ValueTask <T> valueTask) { try { return(await valueTask); } finally { @this.ReturnExecutionSlot(); } }
static async ValueTask <T> SlowExecuteValueCall(SingleThreadInvoker @this, ICall <T> call) { await @this.WaitForExecutionSlot(); try { return(await call.Invoke()); } finally { @this.ReturnExecutionSlot(); } }
static bool FastExecuteValueCall(SingleThreadInvoker @this, ICall <T> call, out ValueTask <T> valueTask) { try { valueTask = call.Invoke(); } catch { @this.ReturnExecutionSlot(); throw; } return(valueTask.IsCompleted); }