CLASS: CQueue
AUTHOR: Smallwaves
DATE: Feb. 4, 2002
DESCRIPTION: This class demostrate how to realize synchronization using mutex and semaphore.You can modify it to fit your use easily I think.

METHOD: CQueue_ELEMENT (STRUCT)
DESCRIPTION: The public CQueue_ELEMENT structure defines what a queue data element looks like. A real-life application would generally not require this information.
m_nThreadNum A member of this structure.
m_nRequestNum A member of this structure.

METHOD: CONSTRUCTOR (:DWORD)
DESCRIPTION: Initialize mutex and semaphore, and allocate memory for CQueue_ELEMENT array.
nMaxElements Max number of CQueue_ELEMENT array.
RETURN: Nothing.

METHOD: destructor (NONE)
DESCRIPTION: Do some clean work.Close mutex and semaphore,free memory for CQueue_ELEMENT array.
RETURN: Nothing.

METHOD: Append (:DWORD, :DWORD)
DESCRIPTION: Append new element to the queue.
pElement Pointer of the new CQueue_ELEMENT.
dwTimeout Timeouts for waiting for appending.
RETURN: FALSE if failed,Call GetLastError for more info.

METHOD: Remove (:DWORD, :DWORD)
DESCRIPTION: Remove a ELEMENT from the queen.
pElement if have,the pointer of a CQueue_ELEMENT that has been removed.
dwTimeout Timeouts for waiting for removing.
RETURN: FALSE if failed,Call GetLastError for more info.



MASM Object To HTML Creator V1.0
Copyright ©2001 NaN Software.
NAN32ASM.CJB.NET