CMSIS-Compiler Support  
Standard C Library File, I/O and OS Retargeting
 
Loading...
Searching...
No Matches
Arm C Library

Declarations of types and functions for integrating an RTOS with the Arm Standard C Library. More...

Data Structures

struct  rt_mutex_t
 Mutex type definition. More...
 

Functions

void * __user_perthread_libspace (void)
 Retrieve thread local storage.
 
int _mutex_initialize (rt_mutex_t *mutex)
 Initialize mutex.
 
void _mutex_acquire (rt_mutex_t *mutex)
 Acquire mutex.
 
void _mutex_release (rt_mutex_t *mutex)
 Release mutex.
 
void _mutex_free (rt_mutex_t *mutex)
 Free mutex.
 

Description

Declarations of types and functions for integrating an RTOS with the Arm Standard C Library.


Data Structure Documentation

◆ rt_mutex_t

struct rt_mutex_t

Mutex type definition.

The rt_mutex_t is an incomplete type, an implementation must define it

Function Documentation

◆ __user_perthread_libspace()

void * __user_perthread_libspace ( void  )

Retrieve thread local storage.

This function returns a pointer to memory for storing data that is local to a particular thread. This means that __user_perthread_libspace() returns a different address depending on the thread it is called from.

◆ _mutex_initialize()

int _mutex_initialize ( rt_mutex_t mutex)

Initialize mutex.

Parameters
[in]mutexPointer to mutex object
Returns
nonzero value on success, otherwise the function returns 0

This function accepts a pointer to a pointer-sized word and initializes it as a valid mutex. By default, _mutex_initialize() returns zero for a nonthreaded application. Therefore, in a multithreaded application, _mutex_initialize() must return a nonzero value on success so that at runtime, the library knows that it is being used in a multithreaded environment. Ensure that _mutex_initialize() initializes the mutex to an unlocked state.

◆ _mutex_acquire()

void _mutex_acquire ( rt_mutex_t mutex)

Acquire mutex.

Parameters
[in]mutexPointer to mutex object

This function causes the calling thread to obtain a lock on the supplied mutex. _mutex_acquire() returns immediately if the mutex has no owner. If the mutex is owned by another thread, _mutex_acquire() must block until it becomes available. _mutex_acquire() is not called by the thread that already owns the mutex.

◆ _mutex_release()

void _mutex_release ( rt_mutex_t mutex)

Release mutex.

Parameters
[in]mutexPointer to mutex object

This function causes the calling thread to release the lock on a mutex acquired by _mutex_acquire(). The mutex remains in existence, and can be re-locked by a subsequent call to mutex_acquire(). _mutex_release() assumes that the mutex is owned by the calling thread.

◆ _mutex_free()

void _mutex_free ( rt_mutex_t mutex)

Free mutex.

Parameters
[in]mutexPointer to mutex object

This function causes the calling thread to free the supplied mutex. Any operating system resources associated with the mutex are freed. The mutex is destroyed and cannot be reused. _mutex_free() assumes that the mutex is owned by the calling thread.