![]() |
SetPriority() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: Win32Thread.h |
Declaration
virtual BOOL SetPriority(
CGenericThread::ThreadPriority aPriority);
DescriptionSet the thread priority (must be set before Start)
Function Body
try
{
static const int iThreadPriority[]={THREAD_PRIORITY_IDLE,
THREAD_PRIORITY_LOWEST,
THREAD_PRIORITY_BELOW_NORMAL,
THREAD_PRIORITY_NORMAL,
THREAD_PRIORITY_ABOVE_NORMAL,
THREAD_PRIORITY_HIGHEST,
THREAD_PRIORITY_TIME_CRITICAL};
//Do we have a thread
if (GetThreadStatus()==tsStopped)
{
//Recreate the thread
//Create the thread in suspend mode
m_hThread=CreateThread(NULL,
0,
Win32Thread,
this,
CREATE_SUSPENDED,
&m_dwThreadID);
//Check if created
if (m_hThread)
SetThreadStatus(tsSuspended);
else
//Can't run
return FALSE;
}
//Now we can set the priority
return SetThreadPriority(m_hThread,iThreadPriority[aPriority]);
}
ERROR_HANDLER_RETURN("SetPriority",FALSE)
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |