#include <system.h>
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 |
Definition at line 33 of file system.h.
| 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 }
| 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 }
const void* const LIFOSemaphore::implData [private] |
Definition at line 41 of file system.h.
Referenced by LIFOSemaphore(), release(), wait(), and ~LIFOSemaphore().
1.5.5