Ejemplo n.º 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 { }
        }
Ejemplo n.º 2
0
 static extern bool SetThreadPriority(IntPtr hThread, ThreadsPriority nPriority);
Ejemplo n.º 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 { }
 }
Ejemplo n.º 4
0
 static extern bool SetThreadPriority(IntPtr hThread, ThreadsPriority nPriority);
Ejemplo n.º 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 { }
        }
Ejemplo n.º 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 { }
 }