コード例 #1
0
ファイル: IOPriority.cs プロジェクト: radtek/mcebuddyviewer
        /// <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 { }
        }
コード例 #2
0
ファイル: IOPriority.cs プロジェクト: radtek/mcebuddyviewer
 static extern bool SetThreadPriority(IntPtr hThread, ThreadsPriority nPriority);
コード例 #3
0
ファイル: IOPriority.cs プロジェクト: radtek/mcebuddyviewer
 /// <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 { }
 }
コード例 #4
0
ファイル: IOPriority.cs プロジェクト: hoeness2/mcebuddy2
 static extern bool SetThreadPriority(IntPtr hThread, ThreadsPriority nPriority);
コード例 #5
0
ファイル: IOPriority.cs プロジェクト: hoeness2/mcebuddy2
        /// <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 { }
        }
コード例 #6
0
ファイル: IOPriority.cs プロジェクト: hoeness2/mcebuddy2
 /// <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 { }
 }