public void InitSvc() { Instance = this; timer = new WZTimer(); timer.SetLog((string info) => { CommonTools.Log(info); }); }
private static readonly string taskLock = "taskLock"; /*任务锁*/ public void Init() { CommonTools.Log("TimerSvc Init ...."); taskPackQueue.Clear(); timer = new WZTimer(100); timer.SetHandle((Action <int> callback, int tid) => { if (callback != null) { lock (taskLock) { taskPackQueue.Enqueue(new TaskPack(tid, callback)); } } }); timer.SetLog((string info) => { CommonTools.Log(info); }); }