Run Lock • AI Agent SDK

Shared lazy run-lock helper for core orchestration modules.

_run_lock

AI Agent

Shared lazy run-lock helper for core orchestration modules.

AgentTeam (agents/agents.py) and Workflow/AgentFlow (workflows/workflows.py) both lazily mint a per-instance re-entrancy lock the first time a run begins. Creation is serialized through a single module-level guard (double-checked locking) so two threads racing into the first start()/astart()/run() observe the same lock object rather than each minting and acquiring its own.

Import

python
from praisonaiagents import _run_lock

Functions

Constants

NameValue
_RUN_LOCK_INIT_GUARDthreading.Lock()