---
name: "CK_COHORT_INIT"
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_INIT"
---

# CK\_COHORT\_INIT(3)

initialize instance of a cohort type

## NAME

**CK\_COHORT\_INIT** – initialize instance of a cohort type

## LIBRARY

Concurrency Kit (libck, -lck)

## SYNOPSIS

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

**CK\_COHORT\_INIT**(*COHORT\_NAME cohort\_name*, *COHORT \*cohort*, *void \*global\_lock*, *void \*local\_lock*, *unsigned int pass\_limit*);

## DESCRIPTION

Until a cohort instance is initialized using the CK\_COHORT\_INIT macro, any operations involving it will have undefined behavior.  After this macro has been called, the cohort pointed to by the *cohort* argument will use the lock pointed to by *global\_lock* as its global lock and the lock pointed to by *local\_lock* as its local lock.

The cohort will relinquish its global lock after *pass\_limit* consecutive acquisitions of its local lock, even if there are other threads waiting. If you are unsure of a value to use for the *pass\_limit* argument, you should use CK\_COHORT\_DEFAULT\_LOCAL\_PASS\_LIMIT.

## SEE ALSO

[ck\_cohort(3)](/ck_cohort/3.md), [CK\_COHORT\_PROTOTYPE(3)](/CK_COHORT_PROTOTYPE/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\_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/
