This class is only available in the RT environment. It has been derived from CIThread to ease the creation of a thread that waits for incoming units at a low level semaphore. It must be used to derive an application specific low level semaphore thread class, or it can be used directly to control a thread object.
Constructor
Destructor
Create
DoForever
OnReceive
The following member variable is only available to the members of the class and its derived classes:
CILLSemaphore * m_pSemaphore;
See CIThread::Constructor.
See CIThread::Destructor.
If the object is already attached, it is first detached. Then this call creates a new active RT thread object and attaches it to the object.
DWORD CILLSemaphoreThread::Create( char * pszName, CILLSemaphore * pSem, BYTE byPrio, DWORD dwStack, BOOLEAN bGo );
pszName
pSem
byPrio
dwStack
bGo
The result is a status indicating success or failure:
E_OK
E_MEM
E_LIMIT
byPrio
contains a bad value, or the object directory is full.
E_SLOT
E_PARAM
dwStack
contains a value of less than 2048, or the name is too long or is improperly formatted.
E_CONTEXT
For details on the code executed by the new thread, See CIThreadCreate.
See CIThread::DoForever. CILLSemaphoreThread::DoForever is called by the framework and should never be called explicitly. CILLSemaphoreThread::DoForever waits for a unit at the low level semaphore (no timeout), calls the OnReceive member (only after successful receive, see below) and returns a boolean status (TRUE for success, FALSE for failure). When overruling this call, do not include a call to the default call.
CILLSemaphoreThread::OnReceive is called by the framework when a unit has been received successfully; it should never be called explicitly. CILLSemaphoreThread::OnReceive just returns TRUE. When overruling this call, there is no need to call the default call.
BOOLEAN CILLSemaphoreThread::OnReceive(void);
None. The result must be TRUE to let the thread continue, FALSE to terminate the thread.