Mutex
Ownership-based mutual exclusion
Mechanism
An ownership-bearing Lock for a shared Resource. An Actor that successfully acquires it becomes the sole owner and may enter the protected section. Only the owner may release it; another contender becomes owner only through a later successful acquisition after release.
Invariants
- Exclusivity: at most one Actor owns the mutex at a time.
- Acquire-before-access: an Actor enters the protected section only after successful acquisition.
- Owner-only release: only the current owner may perform an ordinary release.
- Release-after-use: the owner releases the mutex after leaving the protected section.
Preconditions
- A shared Resource and protected section exist.
- All contenders use the same mutex state.
Postconditions
- A successful acquisition yields exactly one owner.
- Non-owners do not enter the protected section.
- Release removes the former owner's protected access.
Failure modes
- Deadlock: contenders form a wait cycle and no acquisition can complete.
- Orphaned ownership: an owner fails without release, leaving the mutex unavailable.
- Starvation: a contender is repeatedly denied under the selected acquisition policy.
- Ownership violation: a non-owner releases the mutex or enters the protected section.
Caution
Exclusive access — starvation enables denial of service.
Where this came from
—
Builds on
Identity
- Ref:
Mutex#b031 - Hash: sema:Mutex#mh:SHA-256:b031c2dc75f23526ac765e042cd1ff77f66f0a7a23d57e480b30da0a8343e18e
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository