using System.Threading;


namespace SIASUN.Autopilot.Device
{
    public class CanFactory
    {
        public static CanHelper Instance = null;

        public CanFactory()  
        {
            GetCanIns();
        }

        public CanHelper GetCanIns()
        {
            if (Instance != null)
                return Instance;

            CanHelper temp = new CanHelper();
            Interlocked.CompareExchange<CanHelper>(ref Instance, temp, null);
            return Instance;
        }
    }
}
