示例#1
0
文件: Job.cs 项目: martin762/Eddie
        public void Run()
        {
            Int64 now = UtilsCore.UnixTimeStampMs();

            m_timeLastStart = now;
            OnRun();
            m_timeLastEnd = now;

            if (m_thread != null)
            {
                m_thread = null;
            }
        }
示例#2
0
文件: Job.cs 项目: martin762/Eddie
        public void CheckRun()
        {
            if (m_cancelRequested)
            {
                return;
            }

            Int64 now = UtilsCore.UnixTimeStampMs();

            if (m_thread != null)
            {
                // Already running
            }
            else if ((m_timeLastStart != 0) && (m_timeLastEnd < m_timeLastStart))
            {
                // Already running
            }
            else if (now - m_timeLastEnd < m_timeEvery)
            {
                // Not need
            }
            else
            {
                //Engine.Instance.Logs.LogVerbose("Run job " + this.GetType().FullName);
                if (GetSync())
                {
                    Run();
                }
                else
                {
                    m_thread          = new System.Threading.Thread(this.Run);
                    m_thread.Priority = GetPriority();
                    m_thread.Start();
                }
            }
        }
示例#3
0
        public void LogDebug(string message)
        {
            long ts = UtilsCore.UnixTimeStampMs();

            LogVerbose(ts.ToString() + ":" + message);
        }