RTI Connext DDS Micro C API  Version 3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OSAPI Semaphore

Abstract Semaphore API. More...

Typedefs

typedef struct OSAPI_Semaphore OSAPI_Semaphore_T
 Abstract semaphore object.

Functions

OSAPI_Semaphore_TOSAPI_Semaphore_new (void)
 Create a semaphore.
RTI_BOOL OSAPI_Semaphore_delete (OSAPI_Semaphore_T *self)
 Delete a semaphore.
RTI_BOOL OSAPI_Semaphore_take (OSAPI_Semaphore_T *self, RTI_INT32 timeout, RTI_INT32 *fail_reason)
 Take a semaphore.
RTI_BOOL OSAPI_Semaphore_give (OSAPI_Semaphore_T *self)
 Give a semaphore.

Detailed Description

Abstract Semaphore API.


Typedef Documentation

typedef struct OSAPI_Semaphore OSAPI_Semaphore_T

Abstract semaphore object.


Function Documentation

OSAPI_Semaphore_T* OSAPI_Semaphore_new ( void  )

Create a semaphore.

Returns:
Pointer to a semaphore with a value of 1 on success, NULL on failure.
See also:
OSAPI_Semaphore_delete
RTI_BOOL OSAPI_Semaphore_delete ( OSAPI_Semaphore_T self)

Delete a semaphore.

Parameters:
[in]selfSemaphore created with OSAPI_Semaphore_new.
Returns:
RTI_TRUE on success, RTI_FALSE on failure.
See also:
OSAPI_Semaphore_new
RTI_BOOL OSAPI_Semaphore_take ( OSAPI_Semaphore_T self,
RTI_INT32  timeout,
RTI_INT32 *  fail_reason 
)

Take a semaphore.

Parameters:
[in]selfSemaphore previously created with OSAPI_Semaphore_new.
[in]timeoutTimeout in ms. The take call will wait at most timeout ms before returning. If OSAPI_SEMAPHORE_TIMEOUT_INFINITE is specified, the call will not return until the semaphore has a value of 1 or higher.
[out]fail_reasonThis parameter is not used, but present for compatibility reasons.
Returns:
RTI_TRUE on success, RTI_FALSE on failure.
See also:
OSAPI_Semaphore_give
RTI_BOOL OSAPI_Semaphore_give ( OSAPI_Semaphore_T self)

Give a semaphore.

Parameters:
[in]selfSemaphore previously created with OSAPI_Semaphore_new.
Returns:
RTI_TRUE on success, RTI_FALSE on failure.
See also:
OSAPI_Semaphore_take

RTI Connext DDS Micro C API Version 3.0.0 Copyright © Fri Mar 22 2019 Real-Time Innovations, Inc