#include <cSemaphore.h>
A semaphore allows X users of the locked resource. All others must wait. Allow interprocess naming of the semaphore resource. i.e. A mutex allows only one user. Semaphore(1) = mutex Mutex = 1 bathroom door 1 lock. Semaphore = a set of X keys to X bathrooms. like the MFC class cSemaphore http://www.cse.psu.edu/~dheller/cse411/notes/OSC/posix.html
◆ cSemaphore()
GrayLib::cSemaphore::cSemaphore |
( |
int |
iUnlockedCount, |
|
|
int |
iMaxCount, |
|
|
const FILECHAR_t * |
pszName = nullptr |
|
) |
| |
|
inline |
Create a new semaphore.
- iUnlockedCount = the number of signaled states to start <= iMaxCount. iUnlockedCount < 0 = just open an existing semaphore by pszName. don't create a new one.
◆ ~cSemaphore()
GrayLib::cSemaphore::~cSemaphore |
( |
| ) |
|
|
inline |
◆ isValidSemaphore()
bool GrayLib::cSemaphore::isValidSemaphore |
( |
| ) |
const |
|
inline |
◆ LockWait()
◆ Unlock()
bool GrayLib::cSemaphore::Unlock |
( |
LONG |
nReleaseCount = 1 , |
|
|
LONG * |
plPreviousCount = nullptr |
|
) |
| |
|
inline |
Release nReleaseCount locks on the semaphore.
◆ m_pSem
sem_t* GrayLib::cSemaphore::m_pSem |
◆ m_sem
sem_t GrayLib::cSemaphore::m_sem |
The documentation for this class was generated from the following file: