62 #ifndef SHM_MUTEX_N_TRIES 63 #define SHM_MUTEX_N_TRIES 3 66 #ifndef SHM_MUTEX_T_TRIES 67 #define SHM_MUTEX_T_TRIES 50000 int shm_open(key_t key, size_t size, shm_mem_init_func_t mem_init, shm_t *pshm)
Open shared memory segement.
int shm_mutex_init(key_t key, shm_mutex_t *pshmmutex)
Create and initialize a shared memory mutex.
shm_t shm_mutex_t
Shared memory pthread mutex structure type.
void(* shm_mem_init_func_t)(key_t key, void *add, size_t size)
User-supplied shared memory initialization function.
Shared memory structure type.
#define C_DECLS_BEGIN
C declaration block begin in C.
int shm_close(shm_t *pshm)
Close shared memory segement.
RoadNarrows Robotics common configuration file.
int m_shmId
shared memory identifier
#define C_DECLS_END
C declaration block end in C.
int shm_mutex_lock(shm_mutex_t *pshmmutex)
Lock the mutex.
int shm_mutex_unlock(shm_mutex_t *pshmmutex)
Unlock a lock the mutex.
key_t m_shmKey
shared memory key
int shm_mutex_destroy(shm_mutex_t *pshmmutex)
Destroy a shared memory mutex.
int shm_mutex_trylock(shm_mutex_t *pshmmutex)
Try to lock the mutex.
size_t m_shmSize
shared memory size in bytes
void * m_shmAddr
starting addressed of attached shared memory