> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Local Turn Lock • AI Agent SDK

> LocalTurnLock: Default in-process turn lock — today's ``asyncio.Lock`` behaviour.

# LocalTurnLock

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

Default in-process turn lock — today's `asyncio.Lock` behaviour.

Zero-cost, dependency-free implementation of :class:`TurnLockProtocol` for
single-replica / no-backend deployments. It serialises turns within one
process (per event loop) exactly as the existing `LockMap` does, so
upgrading is byte-for-byte backward compatible. It provides **no** cross-
process guarantee — selecting a distributed backend (e.g. `redis`) is what
extends serialisation across replicas.

The `owner`/`ttl` arguments are accepted for protocol symmetry but are
inert here: an in-process `asyncio.Lock` is released deterministically
when the holding task exits, so there is no crashed-holder lease to expire.

## Methods

> [card] [acquire()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/LocalTurnLock-acquire.md)
>
> Instance method.

> [card] [release()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/LocalTurnLock-release.md)
>
> Instance method.

> [card] [hold()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/LocalTurnLock-hold.md)
>
> Instance method.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L7409)
>
> `praisonaiagents/gateway/protocols.py` at line 7409


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.