Exemple #1
0
        /// <summary>
        /// Change the scheduling priority for the I/O operations for a specific thread
        /// </summary>
        /// <param name="thread">Handle to the thread</param>
        /// <param name="priority">I/O Priority</param>
        public static void SetPriority(IntPtr thread, ThreadsPriority priority)
        {
            if (priority == ThreadsPriority.THREAD_MODE_BACKGROUND_BEGIN || priority == ThreadsPriority.THREAD_MODE_BACKGROUND_END)
            {
                throw new ArgumentException("Process mode background can only set for current process");
            }

            try { SetThreadPriority(thread, priority); }
            catch { }
        }
Exemple #2
0
 static extern bool SetThreadPriority(IntPtr hThread, ThreadsPriority nPriority);
Exemple #3
0
 /// <summary>
 /// Change the scheduling priority for the I/O operations for the current thread
 /// </summary>
 /// <param name="priority">I/O Priority</param>
 public static void SetPriority(ThreadsPriority priority)
 {
     try { SetThreadPriority(GetCurrentThread(), priority); }
     catch { }
 }
Exemple #4
0
 static extern bool SetThreadPriority(IntPtr hThread, ThreadsPriority nPriority);
Exemple #5
0
        /// <summary>
        /// Change the scheduling priority for the I/O operations for a specific thread
        /// </summary>
        /// <param name="thread">Handle to the thread</param>
        /// <param name="priority">I/O Priority</param>
        public static void SetPriority(IntPtr thread, ThreadsPriority priority)
        {
            if (priority == ThreadsPriority.THREAD_MODE_BACKGROUND_BEGIN || priority == ThreadsPriority.THREAD_MODE_BACKGROUND_END)
                throw new ArgumentException("Process mode background can only set for current process");

            try { SetThreadPriority(thread, priority); }
            catch { }
        }
Exemple #6
0
 /// <summary>
 /// Change the scheduling priority for the I/O operations for the current thread
 /// </summary>
 /// <param name="priority">I/O Priority</param>
 public static void SetPriority(ThreadsPriority priority)
 {
     try { SetThreadPriority(GetCurrentThread(), priority); }
     catch { }
 }