Beispiel #1
0
        public void CheckRun()
        {
            if (m_cancelRequested)
            {
                return;
            }

            Int64 now = Utils.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();
                }
            }
        }