uLib
User mode C/C++ extended API library for Win32 programmers.
|
#include <uLib/SyncObj.h>
TSemaphore encapsulates an IPC Semaphore object.
Public Functions | |
TSemaphore (LPSECURITY_ATTRIBUTES SecAttr, LONG Count, LONG MaxCount, CSTR Name=NULL) | |
TSemaphore (DWORD Access, bool Inherit, CSTR Name) | |
~TSemaphore () | |
bool | Release (LONG Count, OPTOUT LPLONG OldCount=NULL) |
LONG | ReleaseAll () |
LONG | Lock () |
Public Functions inherited from TSyncObj | |
TSyncObj () | |
TSyncObj (const HANDLE &Src) | |
~TSyncObj () | |
bool | Close () |
bool | Wait (DWORD msWait) |
bool | WaitEx (DWORD msWait, bool Alertable) |
bool | SignalAndWait (HANDLE hWaitFor, DWORD msWait, bool Alertable) |
HANDLE | RegisterWait (WAITORTIMERCALLBACK Callback, PVOID Context, DWORD msWait, DWORD Flags) |
bool | UnregisterWait (HANDLE hWait) |
operator HANDLE () | |
HANDLE | GetHandle () |
bool | Initialized () |
HANDLE | Duplicate (HANDLE TargetProc, bool Inherit, ACCESS_MASK Access=0, DWORD Opt=DUPLICATE_SAME_ACCESS) |
Additional Inherited Members | |
Protected Attributes inherited from TSyncObj | |
HANDLE | _hSync |
TSemaphore::TSemaphore | ( | LPSECURITY_ATTRIBUTES | SecAttr, |
LONG | Count, | ||
LONG | MaxCount, | ||
CSTR | Name = NULL |
||
) |
CreateSemaphore(..)
Definition at line 277 of file SyncObj.cpp.
OpenSemaphore(..)
Definition at line 283 of file SyncObj.cpp.
TSemaphore::~TSemaphore | ( | ) |
Definition at line 289 of file SyncObj.cpp.
bool TSemaphore::Release | ( | LONG | Count, |
OPTOUT LPLONG | OldCount = NULL |
||
) |
ReleaseSemaphore(..)
Definition at line 294 of file SyncObj.cpp.
LONG TSemaphore::ReleaseAll | ( | ) |
Set semaphore to it's max count.
Return released count.
Definition at line 300 of file SyncObj.cpp.
LONG TSemaphore::Lock | ( | ) |
Set to unsignaled.
Return count consumed (for later Release()).
Definition at line 312 of file SyncObj.cpp.