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

NAME

4     CK_COHORT_TRYLOCK — try to acquire cohort lock
5

LIBRARY

7     Concurrency Kit (libck, -lck)
8

SYNOPSIS

10     #include <ck_cohort.h>
11
12     CK_COHORT_TRYLOCK(COHORT_NAME cohort_name, COHORT *cohort,
13         void *global_trylock_context, void *local_trylock_context,
14         void *lock_unlock_context);
15

DESCRIPTION

17     This call attempts to acquire both the local and global (if necessary)
18     locks from cohort.  It can only be used with cohort types that were
19     defined using the CK_COHORT_TRYLOCK_PROTOTYPE(3) macro.  The call will
20     not block and will return a bool that will evaluate to true iff the
21     cohort was successfully acquired.  global_trylock_context will be passed
22     as the second argument to the function that was provided as the
23     global_trylock_method argument to CK_COHORT_TRYLOCK_PROTOTYPE if that
24     method is called, and local_trylock_context will be passed to the func‐
25     tion specified by local_trylock_method.  If the global lock acquisition
26     fails, then the cohort will immediately release its local lock as well,
27     and local_unlock_context will be passed to the function specified by
28     local_unlock_method when this call is made.
29

SEE ALSO

31     ck_cohort(3), CK_COHORT_PROTOTYPE(3), CK_COHORT_TRYLOCK_PROTOTYPE(3),
32     CK_COHORT_INSTANCE(3), CK_COHORT_INITIALIZER(3), CK_COHORT_INIT(3),
33     CK_COHORT_LOCK(3), CK_COHORT_UNLOCK(3), CK_COHORT_LOCKED(3),
34
35     Additional information available at http://concurrencykit.org/
36
37                                March 9, 2013.
Impressum