---
name: "CK_COHORT_PROTOTYPE"
section: "3"
platform: "linux"
package: "libck-dev"
version: "0.7.2-6"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/CK_COHORT_PROTOTYPE"
---

# CK\_COHORT\_PROTOTYPE(3)

define cohort type with specified lock types

## NAME

**CK\_COHORT\_PROTOTYPE** – define cohort type with specified lock types

## LIBRARY

Concurrency Kit (libck, -lck)

## SYNOPSIS

**#include \<ck\_cohort.h\>**

**CK\_COHORT\_PROTOTYPE**(*COHORT\_NAME cohort\_name*, *TYPE global\_lock\_method*, *LOCK\_FXN global\_unlock\_method*, *LOCK\_FXN local\_lock\_method*, *LOCK\_FXN local\_unlock\_method*);

## DESCRIPTION

The ck\_cohort.h header file does not define any cohort types.  Instead, the user must use the CK\_COHORT\_PROTOTYPE or [CK\_COHORT\_TRYLOCK\_PROTOTYPE(3)](/CK_COHORT_TRYLOCK_PROTOTYPE/3.md) macros to define any types they want to use.  They must use CK\_COHORT\_TRYLOCK\_PROTOTYPE if they want their cohort type to support trylock operations. The CK\_COHORT\_PROTOTYPE macro takes the following arguments:

*cohort\_name* : An identifier used for this cohort type.  This will have to be passed to each of the other CK\_COHORT macros.\
 *global\_lock\_method* : The method that should be called to acquire the global lock\
 *global\_unlock\_method* : The method that should be called to relinquish the global lock\
 *local\_lock\_method* : The method that should be called to acquire the local lock\
 *local\_unlock\_method* : The method that should be called to relinquish the local lock

Instances of the defined cohort type can be declared as:\
\
     CK\_COHORT\_INSTANCE(cohort\_name) cohort;

## SEE ALSO

[ck\_cohort(3)](/ck_cohort/3.md), [CK\_COHORT\_TRYLOCK\_PROTOTYPE(3)](/CK_COHORT_TRYLOCK_PROTOTYPE/3.md), [CK\_COHORT\_INSTANCE(3)](/CK_COHORT_INSTANCE/3.md), CK\_COHORT\_INITIALIZER(3), [CK\_COHORT\_INIT(3)](/CK_COHORT_INIT/3.md), [CK\_COHORT\_LOCK(3)](/CK_COHORT_LOCK/3.md), [CK\_COHORT\_UNLOCK(3)](/CK_COHORT_UNLOCK/3.md), CK\_COHORT\_LOCKED(3), [CK\_COHORT\_TRYLOCK(3)](/CK_COHORT_TRYLOCK/3.md),

Additional information available at http://concurrencykit.org/
