RTI Connext Micro C API Version 4.2.0
Loading...
Searching...
No Matches
OSAPI Mutex

Mutex API. More...

Typedefs

typedef struct OSAPI_Mutex OSAPI_Mutex_T
 

Functions

OSPSLDllExport RTI_BOOL OSAPI_Mutex_delete (OSAPI_Mutex_T *mutex)
 Delete a mutex.
 
OSPSLDllExport OSAPI_Mutex_TOSAPI_Mutex_new (void)
 Create a mutex.
 
OSPSLDllExport RTI_BOOL OSAPI_Mutex_take (OSAPI_Mutex_T *self)
 Take a mutex.
 
OSPSLDllExport RTI_BOOL OSAPI_Mutex_give (OSAPI_Mutex_T *self)
 Give a mutex.
 

Detailed Description

Mutex API.

Typedef Documentation

◆ OSAPI_Mutex_T

typedef struct OSAPI_Mutex OSAPI_Mutex_T

Abstract Mutex type

Function Documentation

◆ OSAPI_Mutex_delete()

OSPSLDllExport RTI_BOOL OSAPI_Mutex_delete ( OSAPI_Mutex_T * mutex)

Delete a mutex.

Parameters
[in]mutexDelete a mutex created with OSAPI_Mutex_new.
Returns
RTI_TRUE on success, RTI_FALSE on failure

◆ OSAPI_Mutex_new()

OSPSLDllExport OSAPI_Mutex_T * OSAPI_Mutex_new ( void )

Create a mutex.

Returns
Pointer to a mutex in a not taken condition. NULL on failure.

See Also OSAPI_Mutex_delete

◆ OSAPI_Mutex_take()

OSPSLDllExport RTI_BOOL OSAPI_Mutex_take ( OSAPI_Mutex_T * self)

Take a mutex.

A mutex can only be taken if it is not currently already taken by another thread; it CAN be taken if is it already taken by the same thread. In order to release a mutex, it must be given as many times a it has been taken. Note that take will block indefinitely.

Note: the mutex is not required to support priority inversion; there is no protection against deadlocks or starvation.

Parameters
[in]selfTake a mutex previously created with OSAPI_Mutex_new.
Returns
RTI_TRUE on success, RTI_FALSE on failure

See Also OSAPI_Mutex_give, OSAPI_Mutex_new

◆ OSAPI_Mutex_give()

OSPSLDllExport RTI_BOOL OSAPI_Mutex_give ( OSAPI_Mutex_T * self)

Give a mutex.

A mutex can only be given if it is owned by the calling thread. Furthermore, it must be given as many times as it has been taken.

Parameters
[in]selfTake a mutex previously created with OSAPI_Mutex_new.
Returns
RTI_TRUE on success, RTI_FALSE on failure

See Also OSAPI_Mutex_take, OSAPI_Mutex_new

References RTI_UINT32.