/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/SignalR/common/Shared/AwaitableThreadPool.cs
37 строк
840 B
Shreyas Jejurkar
Refactor : Remove unwanted things (#39548)
16 янв 2022, 21:14
Не верифицирован
16 янв 2022, 21:14
4931b19
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace Microsoft.AspNetCore.Internal; internal static class AwaitableThreadPool { public static Awaitable Yield() { return new Awaitable(); } public readonly struct Awaitable : ICriticalNotifyCompletion { public void GetResult() { } public Awaitable GetAwaiter() => this; public bool IsCompleted => false; public void OnCompleted(Action continuation) { Task.Run(continuation); } public void UnsafeOnCompleted(Action continuation) { OnCompleted(continuation); } } }