Skip to main content

Module lock

Module lock 

Source
Expand description

Directory lock facade for queue and daemon coordination.

Responsibilities:

  • Expose lock acquisition, owner metadata, stale-lock handling, and PID liveness helpers.
  • Keep concurrency-critical concerns split into focused submodules.

Not handled here:

  • Queue mutation or config validation.
  • Cross-machine or distributed locking.

Invariants/assumptions:

  • Callers hold DirLock for the full critical section.
  • The lock directory path is stable for the resource being protected.
  • The task label remains reserved for shared supervisor/task lock semantics.

Structs§

DirLock
Held directory lock guard.
LockOwner
Lock owner metadata parsed from the owner file.

Enums§

PidLiveness
Tri-state PID liveness result.

Constants§

TASK_OWNER_PREFIX

Functions§

acquire_dir_lock
is_supervising_process
is_task_owner_file
pid_is_running
pid_liveness
queue_lock_dir
read_lock_owner