#include <ipc_sem.hpp>
dcf::IPCSem::IPCSem |
( |
bool |
is_local = true | ) |
|
Default constructor. Parameter "is_local" defines does
semaphore live only when object is created or alltime.
virtual dcf::IPCSem::~IPCSem |
( |
| ) |
|
|
virtual |
Removes semaphore if it is not local.
Allocates provided number of resources. Returns ErrSuccess if all correct.
dcf::error_t dcf::IPCSem::create |
( |
size_t |
res_num, |
|
|
int |
id, |
|
|
const std::string & |
fname, |
|
|
int |
mask = 0666 |
|
) |
| |
Constructs new semaphore. Access rules mask.
- Parameters
-
res_num | Number of resources to be allocated/deallocated. |
id | Uniq semaphore id for key generation. |
fname | Exists file name for key generation. |
dcf::error_t dcf::IPCSem::create |
( |
size_t |
res_num, |
|
|
key_t |
key, |
|
|
int |
mask = 0666 |
|
) |
| |
Constructs new semaphore with provided key. Access rules mask.
- Parameters
-
res_num | Number of resources to be allocated/deallocated. |
key | Semaphore uniq key |
Releases provided number of resources. Returns ErrSuccess if all correct.
bool dcf::IPCSem::m_is_local |
|
protected |
Does semaphore should be removed after object destruction.
size_t dcf::IPCSem::m_res_num |
|
protected |
Number of resources for allocation.
Id of semaphore. (>0 if it is created.)
The documentation for this class was generated from the following file:
- /net/opt/univers/ubp-i-15.3-centos7-x64.urij/include/dcf/ipc_sem.hpp