rtapi_mutex(3rtapi)

rtapi_mutex3rtapi

Mutex-related functions

Usage

#include <rtapi_mutex.h>

int rtapi_mutex_try(unsigned long *mutex);
int rtapi_mutex_get(unsigned long *mutex);
int rtapi_mutex_give(unsigned long *mutex);

Arguments

mutex

A pointer to the mutex.

Overview

rtapi_mutex_try makes a non-blocking attempt to get the mutex. If the mutex is available, it returns 0, and the mutex is no longer available. Otherwise, it returns a nonzero value.

rtapi_mutex_get blocks until the mutex is available.

rtapi_mutex_give releases a mutex acquired by rtapi_mutex_try or rtapi_mutex_get.

Realtime considerations

rtapi_mutex_give and rtapi_mutex_try may be used from non-realtime, init/cleanup, and realtime code.

rtapi_mutex_get may not be used from realtime code.

Return value

rtapi_mutex_try returns 0 for if the mutex was claimed, and nonzero otherwise.

rtapi_mutex_get and rtapi_mutex_gif have no return value.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

From linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.