예제 #1
0
        /// <summary>
        /// Gets or sets a priority value outside of application priority space
        /// </summary>
        /// <param name="newPriority">The new Priority, from 0 to 255</param>
        /// <remarks>
        /// <b>WARNING:</b> Adjusting a thread priority with this property can lead to application and even device deadlock or unpredictability.  Use only with caution and strong knowledge of the target system.  Do <u>not</u> use this Property for normal Priority settings.
        /// </remarks>
        public void SetRealtimePriority(int newPriority)
        {
            if (Environment.OSVersion.Platform != PlatformID.WinCE)
            {
                throw new NotSupportedException("This method is supported only under Windows CE");
            }

            if ((newPriority < 0) || (newPriority > 255))
            {
                throw new ArgumentOutOfRangeException("Priority must be between 0 and 255");
            }
            ProcessAPI.CeSetThreadPriority((uint)this.ThreadID, newPriority);
        }
예제 #2
0
 /// <summary>
 /// Sets a value indicating the scheduling priority of a thread.
 /// </summary>
 /// <param name="newPriority">One of the <see cref="System.Threading.ThreadPriority"/> values.</param>
 public void SetPriority(ThreadPriority newPriority)
 {
     ProcessAPI.CeSetThreadPriority((uint)this.ThreadID, (int)newPriority);
 }