/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v7.0.10
src/Npgsql/Util/ManualResetValueTaskSource.cs
21 строка
1 KB
Shay Rojansky
Use file-scoped namespaces (#4225)
18 дек 2021, 13:52
Не верифицирован
18 дек 2021, 13:52
43756d1
Код
Авторство
О чём код?
using System; using System.Threading.Tasks.Sources; namespace Npgsql.Util; sealed class ManualResetValueTaskSource<T> : IValueTaskSource<T>, IValueTaskSource { ManualResetValueTaskSourceCore<T> _core; // mutable struct; do not make this readonly public bool RunContinuationsAsynchronously { get => _core.RunContinuationsAsynchronously; set => _core.RunContinuationsAsynchronously = value; } public short Version => _core.Version; public void Reset() => _core.Reset(); public void SetResult(T result) => _core.SetResult(result); public void SetException(Exception error) => _core.SetException(error); public T GetResult(short token) => _core.GetResult(token); void IValueTaskSource.GetResult(short token) => _core.GetResult(token); public ValueTaskSourceStatus GetStatus(short token) => _core.GetStatus(token); public void OnCompleted(Action<object?> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) => _core.OnCompleted(continuation, state, token, flags); }