예제 #1
0
 public void ChangePriority(WorkerPriorityType priority)
 {
     try
     {
         if (analyseThread != null && analyseThread.IsAlive)
         {
             analyseThread.Priority = OSInfo.GetThreadPriority(priority);
         }
     }
     catch (Exception)
     {
         // process could not be running anymore - ignore
     }
 }
예제 #2
0
 public void start()
 {
     try
     {
         WorkerPriority.GetJobPriority(job, out WorkerPriorityType oPriority, out bool lowIOPriority);
         processThread          = new Thread(new ThreadStart(RunInThread));
         processThread.Priority = OSInfo.GetThreadPriority(oPriority);
         processThread.Start();
         new System.Windows.Forms.MethodInvoker(this.RunStatusCycle).BeginInvoke(null, null);
     }
     catch (Exception e)
     {
         throw new JobRunException(e);
     }
 }
예제 #3
0
        /// <summary>
        /// changes the priority of the encoding process/thread
        /// </summary>
        /// <param name="priority">the priority to change to</param>
        /// <param name="error">output for any errors that might ocurr during this method</param>
        /// <returns>true if the priority has been changed, false if not</returns>
        public void changePriority(WorkerPriorityType priority)
        {
            if (this.processorThread == null || !processorThread.IsAlive)
            {
                return;
            }

            try
            {
                processorThread.Priority = OSInfo.GetThreadPriority(priority);
            }
            catch (Exception e) // process could not be running anymore
            {
                throw new JobRunException(e);
            }
        }
예제 #4
0
        public virtual void changePriority(WorkerPriorityType priority)
        {
            if (!IsRunning())
            {
                return;
            }

            try
            {
                processThread.Priority = OSInfo.GetThreadPriority(priority);
            }
            catch (Exception e) // process could not be running anymore
            {
                throw new JobRunException(e);
            }
        }