On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTKernel-32 Programming Manual
Introduction
Multitasking, Real-Time, and RTKernel-32
Module RTKernel-32
Alternate APIs for RTKernel-32
RTKernel-C 4.5 for DOS Compatible API
Win32 Thread Compatible API
Win32 Priorities
Win32 Handles
Win32 and RTKernel-32 Error Handling
Mixing RTKernel-32 and Win32 APIs
Function GetCurrentThreadId
Function CreateThread
Function ExitThread
Function TerminateThread
Function GetExitCodeThread
Function GetCurrentThread
Function Sleep
Function GetTickCount
Function GetTickCount64
Function SuspendThread
Function ResumeThread
Function SetThreadPriority
Function GetThreadPriority
Function InitializeCriticalSection
Function InitializeCriticalSectionAndSpinCount
Function EnterCriticalSection
Function TryEnterCriticalSection
Function LeaveCriticalSection
Function DeleteCriticalSection
Function CreateEvent
Function CreateMutex
Function CreateSemaphore
Function OpenEvent
Function OpenMutex
Function OpenSemaphore
Function SetEvent
Function ResetEvent
Function PulseEvent
Function ReleaseMutex
Function ReleaseSemaphore
Function WaitForSingleObject
Function WaitForMultipleObjects
Function QueryPerformanceCounter
Function QueryPerformanceFrequency
Function GetThreadId
Function SleepEx
Function QueueUserAPC
Function QueueUserWorkItem
Function GetSystemTimeAdjustment
Function SwitchToThread
Function CreateWaitableTimer
Function SetWaitableTimer
Function OpenWaitableTimer
Function CancelWaitableTimer
Function SetThreadAffinityMask
Function SetThreadGroupAffinity
Supplemental Modules
RTKernel-32 Drivers
Demo Programs
Advanced Topics
Typical Error Sources
Error and Information Messages
RTKernel-32 Reference Manual
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Function SetThreadPriority
SetThreadPriority sets the priority of the given thread relative to a Base. The Base is the value RTKConfig.MainPriority, RTKConfig.DefaultPriority, or the current task's priority (the first non-zero value is used). The priority is changed as follows:
Parameter nPriority |
Priority |
THREAD_PRIORITY_IDLE |
Base - 3 |
THREAD_PRIORITY_LOWEST |
Base - 2 |
THREAD_PRIORITY_BELOW_NORMAL |
Base - 1 |
THREAD_PRIORITY_NORMAL |
Base |
THREAD_PRIORITY_ABOVE_NORMAL |
Base + 1 |
THREAD_PRIORITY_HIGHEST |
Base + 2 |
THREAD_PRIORITY_TIME_CRITICAL |
Base + 3 |
If the resulting priority is below RTK_MIN_PRIO, RTK_MIN_PRIO is used instead. If the resulting priority is above RTK_MAX_PRIO, RTK_MAX_PRIO is used instead.
RTKConfig.MainPriority defaults to 5. This makes the range of priorities 2 to 8 available to Win32 threads.
Win32 Thread Compatible API
Function ResumeThread
Function GetThreadPriority
|