RTEMS CPU Kit with SuperCore  4.11.3
Functions | Variables
muteximpl.h File Reference

Private Inlined Routines for POSIX Mutex's. More...

#include <rtems/posix/mutex.h>
#include <rtems/score/coremuteximpl.h>
#include <errno.h>
Include dependency graph for muteximpl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void _POSIX_Mutex_Manager_initialization (void)
 POSIX Mutex Manager Initialization. More...
 
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control_POSIX_Mutex_Allocate (void)
 POSIX Mutex Allocate. More...
 
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (POSIX_Mutex_Control *the_mutex)
 POSIX Mutex Free. More...
 
int _POSIX_Mutex_Lock_support (pthread_mutex_t *mutex, bool blocking, Watchdog_Interval timeout)
 POSIX Mutex Lock Support Method. More...
 
RTEMS_INLINE_ROUTINE int _POSIX_Mutex_Translate_core_mutex_return_code (CORE_mutex_Status the_mutex_status)
 Convert Score mutex status codes into POSIX status values. More...
 
POSIX_Mutex_Control_POSIX_Mutex_Get (pthread_mutex_t *mutex, Objects_Locations *location)
 POSIX Mutex Get (Thread Dispatch Disable) More...
 
POSIX_Mutex_Control_POSIX_Mutex_Get_interrupt_disable (pthread_mutex_t *mutex, Objects_Locations *location, ISR_lock_Context *lock_context)
 POSIX Mutex Get (Interrupt Disable) More...
 

Variables

POSIX_EXTERN Objects_Information _POSIX_Mutex_Information
 The following defines the information control block used to manage this class of objects.
 
POSIX_EXTERN pthread_mutexattr_t _POSIX_Mutex_Default_attributes
 The default mutex attributes structure.
 
const int _POSIX_Mutex_Return_codes [CORE_MUTEX_STATUS_LAST+1]
 This array contains a mapping from Score Mutex return codes to POSIX return codes.
 

Detailed Description

Private Inlined Routines for POSIX Mutex's.

This include file contains the static inline implementation of the private inlined routines for POSIX mutex's.

Function Documentation

◆ _POSIX_Mutex_Allocate()

RTEMS_INLINE_ROUTINE POSIX_Mutex_Control* _POSIX_Mutex_Allocate ( void  )

POSIX Mutex Allocate.

This function allocates a mutexes control block from the inactive chain of free mutexes control blocks.

References _Objects_Allocate().

◆ _POSIX_Mutex_Free()

RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free ( POSIX_Mutex_Control the_mutex)

POSIX Mutex Free.

This routine frees a mutexes control block to the inactive chain of free mutexes control blocks.

◆ _POSIX_Mutex_Get()

POSIX_Mutex_Control* _POSIX_Mutex_Get ( pthread_mutex_t *  mutex,
Objects_Locations location 
)

POSIX Mutex Get (Thread Dispatch Disable)

A support routine which translates the mutex id into a local pointer. As a side-effect, it may create the mutex.

Note
This version of the method uses a dispatching critical section.

Referenced by _POSIX_Mutex_Translate_core_mutex_return_code(), and pthread_mutex_init().

◆ _POSIX_Mutex_Get_interrupt_disable()

POSIX_Mutex_Control* _POSIX_Mutex_Get_interrupt_disable ( pthread_mutex_t *  mutex,
Objects_Locations location,
ISR_lock_Context lock_context 
)

POSIX Mutex Get (Interrupt Disable)

A support routine which translates the mutex id into a local pointer. As a side-effect, it may create the mutex.

Note
: This version of the method uses an interrupt critical section.

Referenced by _POSIX_Mutex_Translate_core_mutex_return_code().

◆ _POSIX_Mutex_Lock_support()

int _POSIX_Mutex_Lock_support ( pthread_mutex_t *  mutex,
bool  blocking,
Watchdog_Interval  timeout 
)

POSIX Mutex Lock Support Method.

A support routine which implements guts of the blocking, non-blocking, and timed wait version of mutex lock.

Referenced by pthread_mutex_trylock().

◆ _POSIX_Mutex_Manager_initialization()

void _POSIX_Mutex_Manager_initialization ( void  )

POSIX Mutex Manager Initialization.

This routine performs the initialization necessary for this manager.

References _Objects_Initialize_information(), _POSIX_Mutex_Default_attributes, _POSIX_Mutex_Information, and POSIX_SCHEDULER_MAXIMUM_PRIORITY.

◆ _POSIX_Mutex_Translate_core_mutex_return_code()

RTEMS_INLINE_ROUTINE int _POSIX_Mutex_Translate_core_mutex_return_code ( CORE_mutex_Status  the_mutex_status)

Convert Score mutex status codes into POSIX status values.

A support routine which converts core mutex status codes into the appropriate POSIX status values.

Parameters
[in]the_mutex_statusis the mutex status code to translate
Return values
0Mutex status code indicates the operation completed successfully.
EBUSYMutex status code indicates that the operation unable to complete immediately because the resource was unavailable.
EDEADLKMutex status code indicates that an attempt was made to relock a mutex for which nesting is not configured.
EPERMMutex status code indicates that an attempt was made to release a mutex by a thread other than the thread which locked it.
EINVALMutex status code indicates that the thread was blocked waiting for an operation to complete and the mutex was deleted.
ETIMEDOUTMutex status code indicates that the calling task was willing to block but the operation was unable to complete within the time allotted because the resource never became available.

References _POSIX_Mutex_Get(), _POSIX_Mutex_Get_interrupt_disable(), and CORE_MUTEX_STATUS_LAST.