CK_RWCOHORT_INSTANCE(3)

CK_RWCOHORT_INSTANCE3

Declare an instance of a cohort-based reader-writer lock type

Usage

#include <ck_cohort.h>

CK_RWCOHORT_NEUTRAL_INSTANCE(COHORT_NAME cohort_name);

CK_RWCOHORT_RP_INSTANCE(COHORT_NAME cohort_name);

CK_RWCOHORT_WP_INSTANCE(COHORT_NAME cohort_name);

Library

Concurrency Kit (libck, -lck)

Overview

The user must use this macro to declare instances of lock types that they have defined using the CK_RWCOHORT_PROTOTYPE(3) macro. The cohort_name must be the same as the one used in the prototype macro. For instance, if CK_RWCOHORT_PROTOTYPE was called with the name "foo", the CK_RWCOHORT_INSTANCE macro should be called as
CK_RWCOHORT_INSTANCE(foo) cohort;

This macro should also be used when allocating memory for cohorts. For instance, to allocate a block of 4 cohorts:
CK_RWCOHORT_WP_INSTANCE(foo) *cohorts = malloc(4 * sizeof(CK_RWCOHORT_WP_INSTANCE(foo)));

Releases

5 releases since Debian 8 (Jessie); the text changed 1 time.

  1. 8
  2. 9–13

From libck-dev 0.7.2-6 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.