SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
pthread_mutexattr_t Struct Reference

Mutex attributes. More...

#include <stk_c_pthread.h>

Collaboration diagram for pthread_mutexattr_t:

Public Attributes

int __type
 PTHREAD_MUTEX_NORMAL / DEFAULT / RECURSIVE / ERRORCHECK.
int __protocol
 PTHREAD_PRIO_NONE (default) / PTHREAD_PRIO_INHERIT.

Detailed Description

Mutex attributes.

Note
PTHREAD_MUTEX_NORMAL / DEFAULT, PTHREAD_MUTEX_RECURSIVE and PTHREAD_MUTEX_ERRORCHECK are supported. The underlying stk::sync::Mutex is always recursive, so PTHREAD_MUTEX_NORMAL behaves like PTHREAD_MUTEX_RECURSIVE (POSIX leaves relocking a NORMAL mutex undefined, so this is conforming). Behavior per type:
  • NORMAL/DEFAULT, RECURSIVE: relocking by the owner succeeds and must be balanced by the same number of unlocks (maximum depth stk::sync::Mutex::RECURSION_MAX, then EAGAIN).
  • ERRORCHECK: relocking by the owner returns EDEADLK (trylock: EBUSY).
  • all types: unlocking a mutex not owned by the caller returns EPERM.

Definition at line 450 of file stk_c_pthread.h.

Member Data Documentation

◆ __protocol

int pthread_mutexattr_t::__protocol

PTHREAD_PRIO_NONE (default) / PTHREAD_PRIO_INHERIT.

Definition at line 453 of file stk_c_pthread.h.

Referenced by pthread_mutexattr_getprotocol(), pthread_mutexattr_init(), and pthread_mutexattr_setprotocol().

◆ __type

int pthread_mutexattr_t::__type

PTHREAD_MUTEX_NORMAL / DEFAULT / RECURSIVE / ERRORCHECK.

Definition at line 452 of file stk_c_pthread.h.

Referenced by pthread_mutex_init(), pthread_mutexattr_gettype(), pthread_mutexattr_init(), and pthread_mutexattr_settype().


The documentation for this struct was generated from the following file: