1CK_COHORT_TRYLOCK_PRO... BSD Library Functions Manual CK_COHORT_TRYLOCK_PRO...
2

NAME

4     CK_COHORT_TRYLOCK_PROTOTYPE — define cohort type with specified lock
5     types
6

LIBRARY

8     Concurrency Kit (libck, -lck)
9

SYNOPSIS

11     #include <ck_cohort.h>
12
13     CK_COHORT_TRYLOCK_PROTOTYPE(COHORT_NAME cohort_name,
14         LOCK_FXN global_lock_method, LOCK_FXN global_unlock_method,
15         BOOL_LOCK_FXN global_locked_method,
16         BOOL_LOCK_FXN global_trylock_method, LOCK_FXN local_lock_method,
17         LOCK_FXN local_unlock_method, BOOL_LOCK_FXN local_locked_method,
18         BOOL_LOCK_FXN local_trylock_method);
19

DESCRIPTION

21     The ck_cohort.h header file does not define any cohort types.  Instead,
22     the user must use the CK_COHORT_PROTOTYPE or CK_COHORT_TRYLOCK_PROTOTYPE
23     macros to define any types they want to use.  They must use
24     CK_COHORT_TRYLOCK_PROTOTYPE if they want their cohort type to have sup‐
25     port for trylock operations.  The CK_COHORT_TRYLOCK_PROTOTYPE macro takes
26     the following arguments:
27
28     cohort_name : An identifier used for this cohort type.  This will have to
29     be passed to each of the other CK_COHORT macros.
30     global_lock_method : The method that should be called to acquire the
31     global lock
32     global_unlock_method : The method that should be called to relinquish the
33     global lock
34     global_locked_method : This method should return true iff the global lock
35     is acquired by a thread.
36     global_trylock_method : The method that should be called to try to
37     acquire the global lock.  It should not block and return true iff the
38     lock was successfully acquired.
39     local_lock_method : The method that should be called to acquire the local
40     lock
41     local_unlock_method : The method that should be called to relinquish the
42     local lock
43     global_locked_method : This method should return true iff the global lock
44     is acquired by a thread.
45     local_trylock_method : The method that should be called to try to acquire
46     the local lock.  It should not block and return true iff the lock was
47     successfully acquired.
48
49     Instances of the defined cohort type can be declared as:
50         CK_COHORT_INSTANCE(cohort_name) cohort;
51

SEE ALSO

53     ck_cohort(3), CK_COHORT_PROTOTYPE(3), CK_COHORT_INSTANCE(3),
54     CK_COHORT_INITIALIZER(3), CK_COHORT_INIT(3), CK_COHORT_LOCK(3),
55     CK_COHORT_UNLOCK(3), CK_COHORT_LOCKED(3), CK_COHORT_TRYLOCK(3),
56
57     Additional information available at http://concurrencykit.org/
58
59                                March 9, 2013.
Impressum