public static ZLGCan CreateInstance() { if (_instance == null) { lock (lockHelper) { if (_instance == null) { _instance = new ZLGCan(); } } } return(_instance); }
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); }