RTI Connext DDS Micro C++ API
Version 4.1.0
|
Functions | |
NETIO_SHMEMDllExport RTIBool | NETIO_SharedMemorySignalingSemaphore_create (struct NETIO_SharedMemorySignalingSemaphoreHandle *handle, RTI_INT32 *status_out, RTI_INT32 key) |
Initializes a shared memory binary semaphore with the provided key and sets up the handle to access it. | |
NETIO_SHMEMDllExport RTIBool | NETIO_SharedMemorySignalingSemaphore_attach (struct NETIO_SharedMemorySignalingSemaphoreHandle *handle, RTI_INT32 *status_out, RTI_INT32 key) |
Attach to an existing shared memory binary semaphore with the provided key and sets up the handle to access it. | |
NETIO_SHMEMDllExport RTIBool | NETIO_SharedMemorySignalingSemaphore_create_or_attach (struct NETIO_SharedMemorySignalingSemaphoreHandle *handle, RTI_INT32 *status_out, RTI_INT32 key) |
Attempts to create a new binary semaphore with the provided key and if the semaphore already exist, attach to it. | |
NETIO_SHMEMDllExport RTIBool | NETIO_SharedMemorySignalingSemaphore_signal (struct NETIO_SharedMemorySignalingSemaphoreHandle *handle, RTI_INT32 *status_out) |
Give the semaphore. | |
NETIO_SHMEMDllExport RTIBool | NETIO_SharedMemorySignalingSemaphore_wait (struct NETIO_SharedMemorySignalingSemaphoreHandle *handle, RTI_INT32 *status_out) |
Take the semaphore. | |
NETIO_SHMEMDllExport RTIBool | NETIO_SharedMemorySignalingSemaphore_detach (struct NETIO_SharedMemorySignalingSemaphoreHandle *handle) |
Detach from the shared memory binary semaphore. | |
NETIO_SHMEMDllExport RTIBool | NETIO_SharedMemorySignalingSemaphore_delete (struct NETIO_SharedMemorySignalingSemaphoreHandle *handle) |
Detach from the shared memory semaphore and deletes it. |
NETIO_SHMEMDllExport RTIBool NETIO_SharedMemorySignalingSemaphore_create | ( | struct NETIO_SharedMemorySignalingSemaphoreHandle * | handle, |
RTI_INT32 * | status_out, | ||
RTI_INT32 | key | ||
) |
Initializes a shared memory binary semaphore with the provided key and sets up the handle to access it.
[in,out] | handle | The shared memory semaphore handle to initialize. |
[out] | status_out | Optional: if not NULL is set to the reason why the call has succeeded or failed. In particular:
|
[in] | key | Key to identify the shared memory semaphore across processes. Other processes should call NETIO_SharedMemorySignalingSemaphore_attach with the same key to attach to this semaphore. |
NETIO_SHMEMDllExport RTIBool NETIO_SharedMemorySignalingSemaphore_attach | ( | struct NETIO_SharedMemorySignalingSemaphoreHandle * | handle, |
RTI_INT32 * | status_out, | ||
RTI_INT32 | key | ||
) |
Attach to an existing shared memory binary semaphore with the provided key and sets up the handle to access it.
[out] | handle | The shared memory semaphore handle to initialize. |
[out] | status_out | Optional. If not NULL, will be set to:
|
[in] | key | Key to identify the shared memory semaphore across processes. |
NETIO_SHMEMDllExport RTIBool NETIO_SharedMemorySignalingSemaphore_create_or_attach | ( | struct NETIO_SharedMemorySignalingSemaphoreHandle * | handle, |
RTI_INT32 * | status_out, | ||
RTI_INT32 | key | ||
) |
Attempts to create a new binary semaphore with the provided key and if the semaphore already exist, attach to it.
[in,out] | handle | The shared memory semaphore handle to initialize. |
[out] | status_out | Optional: if not NULL is set to the reason why the call has succeeded or failed. In particular:
|
[in] | key | Key to identify the shared memory binary semaphore across processes. |
NETIO_SHMEMDllExport RTIBool NETIO_SharedMemorySignalingSemaphore_signal | ( | struct NETIO_SharedMemorySignalingSemaphoreHandle * | handle, |
RTI_INT32 * | status_out | ||
) |
Give the semaphore.
[in] | handle | Handle to the semaphore. Must match the one returned by NETIO_SharedMemorySignalingSemaphore_create |
[out] | status_out | Optional: if not NULL, will be set to:
|
NETIO_SHMEMDllExport RTIBool NETIO_SharedMemorySignalingSemaphore_wait | ( | struct NETIO_SharedMemorySignalingSemaphoreHandle * | handle, |
RTI_INT32 * | status_out | ||
) |
Take the semaphore.
[in] | handle | Handle to the semaphore. Must match the one returned by NETIO_SharedMemorySignalingSemaphore_create |
[out] | status_out | Optional: if not NULL, will be set to:
|
NETIO_SHMEMDllExport RTIBool NETIO_SharedMemorySignalingSemaphore_detach | ( | struct NETIO_SharedMemorySignalingSemaphoreHandle * | handle | ) |
Detach from the shared memory binary semaphore.
[in] | handle | Handle to the shared memory semaphore obtained from NETIO_SharedMemorySignalingSemaphore_attach |
NETIO_SHMEMDllExport RTIBool NETIO_SharedMemorySignalingSemaphore_delete | ( | struct NETIO_SharedMemorySignalingSemaphoreHandle * | handle | ) |
Detach from the shared memory semaphore and deletes it.
The exact behavior of this may be OS dependent. In some OSs calling this will immediately cause the semaphore to be removed, and other threads waiting on it to be woken up. This is the typical behavior on Unix. In other OSs (windows) this call just requests the semaphore to be removed but delay the removal until all handles are detached.
The only way to ensure the same behavior across multiple OSs is to only call this method on the handle that created the semaphore after all the other handles have been closed. In this scenario no handles will get an error. Alternatively the code could be written to always expect the NETIO_SharedMemorySignalingSemaphore_wait or NETIO_SharedMemorySignalingSemaphore_signal call to fail and when that occurs close the handle.
[in] | handle | Handle to the shared memory semaphore obtained from NETIO_SharedMemorySignalingSemaphore_create |