LIFOSemaphore Class Reference

#include <system.h>

List of all members.

Public Member Functions

 LIFOSemaphore (unsigned long initCount=0L)
virtual ~LIFOSemaphore ()
void release (unsigned long relCount=1)
void wait (unsigned long timeoutMillisec=0xFFFFFFFF)

Private Attributes

const void *const implData


Detailed Description

Definition at line 33 of file system.h.


Constructor & Destructor Documentation

LIFOSemaphore::LIFOSemaphore ( unsigned long  initCount = 0L  ) 

Definition at line 63 of file system.cpp.

References implData, and release().

00063                                                         :
00064         implData((void*)CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0))
00065     {
00066 //          *((HANDLE *)&implData) = 
00067 //                  CreateIoCompletionPort( INVALID_HANDLE_VALUE, NULL, 0, 0 );
00068             assert(implData);
00069         if( initCount > 0 ) release( initCount );
00070     }

LIFOSemaphore::~LIFOSemaphore ( void   )  [virtual]

Definition at line 72 of file system.cpp.

References implData.

00073     {
00074             CloseHandle( *((HANDLE *)&implData) );
00075     }


Member Function Documentation

void LIFOSemaphore::release ( unsigned long  relCount = 1  ) 

Definition at line 91 of file system.cpp.

References implData.

Referenced by LIFOSemaphore().

00092     {
00093             while( relCount-- > 0 )
00094             {
00095                     PostQueuedCompletionStatus(
00096                             *((HANDLE *)&implData),
00097                             0, 
00098                             0, 
00099                             0 );
00100             }
00101     }

void LIFOSemaphore::wait ( unsigned long  timeoutMillisec = 0xFFFFFFFF  ) 

Definition at line 77 of file system.cpp.

References implData.

00078     {
00079             DWORD                       numberOfBytesTransferred;
00080             DWORD                       completionKey;
00081             LPOVERLAPPED        lpOverlapped;
00082 
00083             GetQueuedCompletionStatus(
00084                     *((HANDLE *)&implData), 
00085                     &numberOfBytesTransferred, 
00086                     &completionKey, 
00087                     &lpOverlapped, 
00088                     timeout ); 
00089     }


Member Data Documentation

const void* const LIFOSemaphore::implData [private]

Definition at line 41 of file system.h.

Referenced by LIFOSemaphore(), release(), wait(), and ~LIFOSemaphore().


The documentation for this class was generated from the following files:

Generated on Wed Mar 19 14:59:59 2008 for rwlock by  doxygen 1.5.5