Microsoft Windows CE 3.0  

CQueue Class

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This class implements a simple queue abstract data type. The queue contains a finite number of objects, and a semaphore controls access to these objects. The semaphore is created with an initial count (N). Each time an object is added, a call to the Microsoft Win32 WaitForSingleObjectfunction is made on the handle of the semaphore. When this function returns, it reserves a slot in the queue for the new object. If no slots are available, the member function blocks until it becomes available. Each time an object is removed from the queue, the Win32 ReleaseSemaphorefunction is called on the handle of the semaphore, thus freeing a slot in the queue. If no objects are present in the queue, the function blocks until an object has been added.

Member Functions

CQueue Constructs a CQueueobject.
GetQueueObject Retrieves an object from the queue.
PutQueueObject Puts an object into the queue.