1CK_RWCOHORT_INSTANCE(3)  BSD Library Functions Manual  CK_RWCOHORT_INSTANCE(3)
2

NAME

4     CK_RWCOHORT_INSTANCE — declare an instance of a cohort-based reader-
5     writer lock type
6

LIBRARY

8     Concurrency Kit (libck, -lck)
9

SYNOPSIS

11     #include <ck_cohort.h>
12
13     CK_RWCOHORT_NEUTRAL_INSTANCE(COHORT_NAME cohort_name);
14
15     CK_RWCOHORT_RP_INSTANCE(COHORT_NAME cohort_name);
16
17     CK_RWCOHORT_WP_INSTANCE(COHORT_NAME cohort_name);
18

DESCRIPTION

20     The user must use this macro to declare instances of lock types that they
21     have defined using the CK_RWCOHORT_PROTOTYPE(3) macro.  The cohort_name
22     must be the same as the one used in the prototype macro.  For instance,
23     if CK_RWCOHORT_PROTOTYPE was called with the name "foo", the CK_RWCO‐
24     HORT_INSTANCE macro should be called as
25     CK_RWCOHORT_INSTANCE(foo) cohort;
26
27     This macro should also be used when allocating memory for cohorts.  For
28     instance, to allocate a block of 4 cohorts:
29     CK_RWCOHORT_WP_INSTANCE(foo) *cohorts = malloc(4 * sizeof(CK_RWCO‐
30     HORT_WP_INSTANCE(foo)));
31

SEE ALSO

33     ck_rwcohort(3), CK_RWCOHORT_PROTOTYPE(3),
34     CK_RWCOHORT_TRYLOCK_PROTOTYPE(3), CK_RWCOHORT_INSTANCE(3),
35     CK_RWCOHORT_INITIALIZER(3), CK_RWCOHORT_LOCK(3), CK_RWCOHORT_UNLOCK(3),
36     CK_RWCOHORT_LOCKED(3), CK_RWCOHORT_TRYLOCK(3),
37
38     Additional information available at http://concurrencykit.org/
39
40                              February 24, 2013.
Impressum