Skip to main content

_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

Functions

ensure_run_lock()

Lazily mint obj._run_lock under a shared module guard.

Constants