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>

Public Attributes

int __type
 PTHREAD_MUTEX_NORMAL / DEFAULT / RECURSIVE / ERRORCHECK.

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 308 of file stk_c_pthread.h.

Member Data Documentation

◆ __type

int pthread_mutexattr_t::__type

PTHREAD_MUTEX_NORMAL / DEFAULT / RECURSIVE / ERRORCHECK.

Definition at line 310 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: