SafeAPI Backend POSIX
POSIX/Linux OAL backend for safeAPIFreamwork
Loading...
Searching...
No Matches
sapi_posix_backend_mutex.c File Reference

POSIX sapi_mutex backend: a thin wrapper over pthread_mutex_t (ADR-033, safeAPIFreamwork). This is the ONE file in the whole stack allowed to touch pthread_mutex_* directly - see sapi_mutex.h's own doc for why an application must never do so itself. More...

#include "safeapi/posix_backend/sapi_posix_backend.h"
#include <pthread.h>
#include "safeapi/oal/memory/sapi_mem_util.h"
Include dependency graph for sapi_posix_backend_mutex.c:

Go to the source code of this file.

Data Structures

struct  posix_mutex_state_t

Typedefs

typedef char posix_mutex_storage_fits_[(sizeof(posix_mutex_state_t)<=sizeof(sapi_mutex_storage_t)) ? 1 :-1]

Functions

static sapi_status_t backend_create (sapi_mutex_storage_t *storage, sapi_mutex_handle_t *out_handle)
static sapi_status_t backend_lock (sapi_mutex_handle_t handle)
static sapi_status_t backend_unlock (sapi_mutex_handle_t handle)
static sapi_status_t backend_destroy (sapi_mutex_handle_t handle)
const sapi_mutex_backend_t * sapi_posix_backend_mutex (void)
 The POSIX sapi_mutex backend (a thin pthread_mutex_t wrapper, ADR-033).

Variables

static const sapi_mutex_backend_t s_posix_mutex_backend

Detailed Description

POSIX sapi_mutex backend: a thin wrapper over pthread_mutex_t (ADR-033, safeAPIFreamwork). This is the ONE file in the whole stack allowed to touch pthread_mutex_* directly - see sapi_mutex.h's own doc for why an application must never do so itself.

Definition in file sapi_posix_backend_mutex.c.

Typedef Documentation

◆ posix_mutex_storage_fits_

typedef char posix_mutex_storage_fits_[(sizeof(posix_mutex_state_t)<=sizeof(sapi_mutex_storage_t)) ? 1 :-1]

Definition at line 26 of file sapi_posix_backend_mutex.c.

Function Documentation

◆ backend_create()

sapi_status_t backend_create ( sapi_mutex_storage_t * storage,
sapi_mutex_handle_t * out_handle )
static

Local function declarations

Definition at line 50 of file sapi_posix_backend_mutex.c.

◆ backend_destroy()

sapi_status_t backend_destroy ( sapi_mutex_handle_t handle)
static

Definition at line 127 of file sapi_posix_backend_mutex.c.

◆ backend_lock()

sapi_status_t backend_lock ( sapi_mutex_handle_t handle)
static

Definition at line 97 of file sapi_posix_backend_mutex.c.

◆ backend_unlock()

sapi_status_t backend_unlock ( sapi_mutex_handle_t handle)
static

Definition at line 112 of file sapi_posix_backend_mutex.c.

◆ sapi_posix_backend_mutex()

const sapi_mutex_backend_t * sapi_posix_backend_mutex ( void )

The POSIX sapi_mutex backend (a thin pthread_mutex_t wrapper, ADR-033).

Global variables declarations Global functions

Definition at line 42 of file sapi_posix_backend_mutex.c.

Variable Documentation

◆ s_posix_mutex_backend

const sapi_mutex_backend_t s_posix_mutex_backend
static
Initial value:
= { backend_create, backend_lock, backend_unlock,
backend_destroy }
static sapi_status_t backend_create(sapi_mutex_storage_t *storage, sapi_mutex_handle_t *out_handle)

Local variables declarations

Definition at line 35 of file sapi_posix_backend_mutex.c.