#include <IPCMutex.hpp>
Public Member Functions | |
| IPCMutex (int semId) | |
| Construct an IPCMutex instance. | |
| ~IPCMutex () | |
| void | wait () |
| Wait on the process semaphore. | |
| void | signal () |
| Signal the process semaphore. | |
| int | getId () |
| Get the process semaphore ID. | |
Static Public Member Functions | |
| static void | free (int semKey) |
| Free the system resources associated with the process semaphore. | |
Private Attributes | |
| int | m_semid |
| struct sembuf | m_sbuf |
| union BLOCXX_NAMESPACE::IPCMutex::semun | m_arg |
Classes | |
| union | semun |
Also the tests are disabled. TODO: Fix it.
Definition at line 61 of file IPCMutex.hpp.
| BLOCXX_NAMESPACE::IPCMutex::IPCMutex | ( | int | semId | ) |
Construct an IPCMutex instance.
The first time this ctor is called with a given semId, the process semaphore will be created. When the semaphore is no longer needed, IPCMutex::free() should be called with the same semId.
| semId | A unique identifier for the process mutex. |
| IPCMutexException | if unable to create a process semaphore |
Definition at line 53 of file IPCMutex.cpp.
References BLOCXX_THROW, BLOCXX_THROW_ERRNO_MSG, m_arg, m_sbuf, m_semid, and BLOCXX_NAMESPACE::IPCMutex::semun::val.
| BLOCXX_NAMESPACE::IPCMutex::~IPCMutex | ( | ) | [inline] |
Definition at line 75 of file IPCMutex.hpp.
| void BLOCXX_NAMESPACE::IPCMutex::wait | ( | ) |
Wait on the process semaphore.
Definition at line 78 of file IPCMutex.cpp.
References BLOCXX_NAMESPACE::BLOCK_FOR_KEY, BLOCXX_THROW_ERRNO_MSG, m_sbuf, and m_semid.
Referenced by BLOCXX_NAMESPACE::IPCMutexLock::IPCMutexLock().
| void BLOCXX_NAMESPACE::IPCMutex::signal | ( | ) |
Signal the process semaphore.
Definition at line 90 of file IPCMutex.cpp.
References BLOCXX_NAMESPACE::ADD_KEY, BLOCXX_THROW_ERRNO_MSG, m_sbuf, and m_semid.
Referenced by BLOCXX_NAMESPACE::IPCMutexLock::~IPCMutexLock().
| int BLOCXX_NAMESPACE::IPCMutex::getId | ( | ) | [inline] |
Get the process semaphore ID.
Definition at line 90 of file IPCMutex.hpp.
References m_semid.
| void BLOCXX_NAMESPACE::IPCMutex::free | ( | int | semKey | ) | [static] |
Free the system resources associated with the process semaphore.
| semKey | The key to the process semaphore resources to free |
Definition at line 103 of file IPCMutex.cpp.
int BLOCXX_NAMESPACE::IPCMutex::m_semid [private] |
Definition at line 98 of file IPCMutex.hpp.
Referenced by getId(), IPCMutex(), signal(), and wait().
struct sembuf BLOCXX_NAMESPACE::IPCMutex::m_sbuf [read, private] |
union BLOCXX_NAMESPACE::IPCMutex::semun BLOCXX_NAMESPACE::IPCMutex::m_arg [private] |
Referenced by IPCMutex().
1.5.6