RTEMS  5.0.0
Functions | Variables
mutexinit.c File Reference

Initialize a Mutex. More...

#include <rtems/posix/muteximpl.h>
#include <rtems/posix/posixapi.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/score/schedulerimpl.h>
#include <limits.h>

Functions

 RTEMS_STATIC_ASSERT (offsetof(POSIX_Mutex_Control, flags)==offsetof(pthread_mutex_t, _flags), POSIX_MUTEX_CONTROL_FLAGS)
 
 RTEMS_STATIC_ASSERT (offsetof(POSIX_Mutex_Control, Recursive)==offsetof(pthread_mutex_t, _Recursive), POSIX_MUTEX_CONTROL_RECURSIVE)
 
 RTEMS_STATIC_ASSERT (offsetof(POSIX_Mutex_Control, Priority_ceiling)==offsetof(pthread_mutex_t, _Priority_ceiling), POSIX_MUTEX_CONTROL_PRIORITY_CEILING)
 
 RTEMS_STATIC_ASSERT (offsetof(POSIX_Mutex_Control, scheduler)==offsetof(pthread_mutex_t, _scheduler), POSIX_MUTEX_CONTROL_SCHEDULER)
 
 RTEMS_STATIC_ASSERT (sizeof(POSIX_Mutex_Control)==sizeof(pthread_mutex_t), POSIX_MUTEX_CONTROL_SIZE)
 
int pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
 

Variables

const pthread_mutexattr_t _POSIX_Mutex_Default_attributes
 

Detailed Description

Initialize a Mutex.

Function Documentation

◆ pthread_mutex_init()

int pthread_mutex_init ( pthread_mutex_t *  mutex,
const pthread_mutexattr_t *  attr 
)

11.3.2 Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87

NOTE: XXX Could be optimized so all the attribute error checking is not performed when attr is NULL.

Variable Documentation

◆ _POSIX_Mutex_Default_attributes

const pthread_mutexattr_t _POSIX_Mutex_Default_attributes
Initial value:
= {
.is_initialized = true,
.process_shared = PTHREAD_PROCESS_PRIVATE,
.prio_ceiling = INT_MAX,
.protocol = PTHREAD_PRIO_NONE,
.recursive = false
}

The default mutex attributes structure.