The CILLSemaphore class encapsulates the low level RT semaphore object; it allows sending and receiving units, which may represent any application dependent resource. The CILLSemaphore class is typically used as it is.
Constructor
Destructor
Create
Release
Wait
The following member variables are only available to the members of the class and its derived classes:
KNHANDLE m_hLLObject; PVOID m_pArea;
The class member m_hRTObject is either NULL_RTHANDLE (not attached) or BAD_RTHANDLE (attached).
The Lookup and Attach functions are useless as they operate on RTHANDLEs.
The constructor has no arguments. It creates an unattached object.
If the object is attached, the destructor detaches it; then it destroys the object.
If the object is already attached, it is first detached. Then this call creates an low level RT semaphore object and attaches it to the object.
DWORD CILLSemaphore::Create( DWORD dwFlags );
dwFlags
E_OK
With this call one unit is released to the semaphore.
DWORD CILLSemaphore::Release(void);
The result is a status indicating success or failure.
E_OK
E_EXIST
This call puts the thread in a sleep state until one unit is available, or until a timeout occurs.
DWORD CILLSemaphore::Wait( DWORD dwUsecs );
dwUsecs
E_OK
E_KN_TIME_OUT
E_KN_NONEXIST
E_EXIST