- When making significant changes, update the relevant docs in
docs/. - When writing or modifying PlusCal/TLA+ specs, follow
specs/PLUSCAL.md.
- Never call
block_current_thread()directly. UseWaitCondition::wait_while()or the splitmark_blocked()/wait_until_unblocked()pair. Seedocs/blocking-protocol.md. - One lock acquisition = one atomic step. If two operations must be atomic (e.g. check + register waiter + mark blocked), they must be under the same lock. Never split check-then-act across separate lock/unlock cycles.
- Mark blocked under the caller's lock. Call
scheduler::mark_blocked()before dropping the guard, so thatunblock()is guaranteed to findThreadState::Blocked. - Tag spec correspondence. Annotate Rust code with
// [spec: file.tla Label]comments to link to the PlusCal model. Seespecs/PLUSCAL.mdfor the convention.