// Copyright © 2017-2018 Atomic Software, LLC. All Rights Reserved.
// See LICENSE.md for full license information.

using System;

namespace Atom.Core.Threading
{
    internal static class PooledDelegateHelper
    {
        public static void AddReference(Delegate pooledDelegate)
        {
            var Closure = pooledDelegate.Target as IPooledClosure;
            Closure?.AddReference();
        }

        public static void Release(Delegate pooledDelegate)
        {
            var Closure = pooledDelegate.Target as IPooledClosure;
            Closure?.Release();
        }
    }
}
