Skip to content

docs(drain): document the per-pane lock hierarchy and no-nesting invariant#52

Open
roramirez wants to merge 1 commit into
mainfrom
hardening/05-lock-hierarchy
Open

docs(drain): document the per-pane lock hierarchy and no-nesting invariant#52
roramirez wants to merge 1 commit into
mainfrom
hardening/05-lock-hierarchy

Conversation

@roramirez

@roramirez roramirez commented Jun 30, 2026

Copy link
Copy Markdown
Owner

What

The parser thread and the main thread share three per-pane locks (grid, log_file, pending_resize) with no written acquisition rule, so a future change could introduce inconsistent ordering and risk a deadlock.

Changes

  • Document in drain.rs the primary invariant (never hold more than one at a time; every site acquires, works, and releases before the next) and the canonical order for any future nesting (log_file > grid > pending_resize).
  • Add a cross-reference at the resize site in pane_ops.rs.
  • Audit of drain.rs, render_ops.rs, and pane_ops.rs: no violations found, no code reorder needed.

Card

plan-todo/05-hardening-orden-locks.md

…riant

The parser thread and the main thread share three per-pane locks (grid,
log_file, pending_resize) with no written acquisition rule, so a future
change could introduce inconsistent ordering and risk deadlock. Document
the primary invariant (never hold more than one at a time; every site
acquires, works, and releases before the next) and the canonical order for
any future nesting (log_file > grid > pending_resize), and add a
cross-reference at the pane_ops resize site. Audit of drain.rs,
render_ops.rs, and pane_ops.rs found no violations — no code reorder
needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant