---
name: "CK_RWCOHORT_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_RWCOHORT_INIT"
---

# CK\_RWCOHORT\_INIT(3)

initialize instance of a cohort-based reader-writer lock type

## NAME

**CK\_RWCOHORT\_INIT** – initialize instance of a cohort-based reader-writer lock type

## LIBRARY

Concurrency Kit (libck, -lck)

## SYNOPSIS

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

**CK\_RWCOHORT\_NEUTRAL\_INIT**(*COHORT\_NAME cohort\_name*, *LOCK \*lock*);

**CK\_RWCOHORT\_RP\_INIT**(*COHORT\_NAME cohort\_name*, *LOCK \*lock*, *unsigned int wait\_limit*);

**CK\_RWCOHORT\_WP\_INIT**(*COHORT\_NAME cohort\_name*, *LOCK \*lock*, *unsigned int wait\_limit*);

## DESCRIPTION

This macro initializes the lock instance pointed to by the *lock* argument.  Until a lock instance is initialized using the CK\_RWCOHORT\_INIT macro, any operations involving it will have undefined behavior.  Note that the *wait\_limit* argument should only be used with reader-preference or writer-preference locks.  For neutral locks, this argument should be excluded. If you are unsure of a value to use for the *wait\_limit* argument, you should use CK\_RWCOHORT\_STRATEGY\_DEFAULT\_LOCAL\_WAIT\_LIMIT.

## SEE ALSO

[ck\_rwcohort(3)](/ck_rwcohort/3.md), [CK\_RWCOHORT\_PROTOTYPE(3)](/CK_RWCOHORT_PROTOTYPE/3.md), CK\_RWCOHORT\_TRYLOCK\_PROTOTYPE(3), [CK\_RWCOHORT\_INSTANCE(3)](/CK_RWCOHORT_INSTANCE/3.md), CK\_RWCOHORT\_INITIALIZER(3), CK\_RWCOHORT\_LOCK(3), CK\_RWCOHORT\_UNLOCK(3), CK\_RWCOHORT\_LOCKED(3), CK\_RWCOHORT\_TRYLOCK(3),

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