This class is only available in the RT environment. It has been derived from CIThread to ease the creation of a thread that has to execute regularly, using a low level alarm; the period runs independent of the thread. The class must be used to derive an application specific low level poll thread class, or it can be used directly to control a thread object.
Constructor
Destructor
Create
DoForever
OnPoll
SetPoll
The following member variables are only available to the members of the class and its derived classes:
DWORD m_dwUsecs; KNHANDLE m_hAlarm; DWORD m_dwAlarm[KN_ALARM_EVENT_SIZE/4]; BOOLEAN m_bChanged;
See CIThread::Constructor.
See CIThread::Destructor. The destructor deletes the alarm, if it had been created already.
If the object is already attached, it is first detached. Then this call creates a new RT thread object and attaches it to the object.
DWORD CILLPollThread::Create( char * pszName, DWORD dwUsecs, BYTE byPrio, DWORD dwStack, BOOLEAN bGo );
pszName
dwUsecs
byPrio
byPrio
< 254.
dwStack
bGo
E_OK
E_MEM
E_LIMIT
E_SLOT
E_PARAM
dwStack
contains a value of less than 2048, or the name is too long or is improperly formatted.
E_CONTEXT
See CIThread::DoForever. CILLPollThread::DoForever is called by the framework and should never be called explicitly. CILLPollThread::DoForever waits for the alarm event, calls the OnPoll member and returns its result. When overruling this call, do not include a call to the default call.
CILLPollThread::OnPoll is called by the framework when a period has passed; it should never be called explicitly. CILLPollThread::OnPoll just returns TRUE. When overruling this call, there is no need to call the default call.
BOOLEAN CILLPollThread::OnPoll(void);
None. The result must be TRUE to let the thread continue, FALSE to terminate the thread.
With this call the poll period can be changed. The new value becomes active in the next period.
void CILLPollThread::SetPoll( DWORD dwUsecs );
dwUsecs