ChangeCallbackRegistrar
using Microsoft.Extensions.FileProviders;
using System;
using System.Runtime.CompilerServices;
using System.Threading;
namespace Microsoft.Extensions.Internal
{
    internal static class ChangeCallbackRegistrar
    {
        [System.Runtime.CompilerServices.NullableContext(1)]
        internal static IDisposable UnsafeRegisterChangeCallback<[System.Runtime.CompilerServices.Nullable(2)] T>([System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            2
        })] Action<object> callback, [System.Runtime.CompilerServices.Nullable(2)] object state, CancellationToken token, Action<T> onFailure, T onFailureState)
        {
            bool flag = false;
            if (!ExecutionContext.IsFlowSuppressed()) {
                ExecutionContext.SuppressFlow();
                flag = true;
            }
            try {
                return token.Register(callback, state);
            } catch (ObjectDisposedException) {
                onFailure(onFailureState);
            } finally {
                if (flag)
                    ExecutionContext.RestoreFlow();
            }
            return Microsoft.Extensions.FileProviders.EmptyDisposable.Instance;
        }
    }
}