Beispiel #1
0
 public static Peakcan CreateInstance()
 {
     if (_instance == null)
     {
         lock (lockHelper)
         {
             if (_instance == null)
             {
                 _instance = new Peakcan();
             }
         }
     }
     return(_instance);
 }
Beispiel #2
0
        private WorkThread()
        {
#if PEAKCAN
            _CanObj = Peakcan.CreateInstance();
#else
            _CanObj = ZLGCan.CreateInstance();
#endif

            _ModuleList = new SortedList <uint, TBaseModule>();

            //写线程
            Task.Factory.StartNew(WriteCanBusThread, cancelTokenSource.Token);

            //读线程
            Task.Factory.StartNew(ReadCanBusThread, cancelTokenSource2.Token);
        }