{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "Lock",
 "ref": "Lock#95c2",
 "hash": "sema:Lock#mh:SHA-256:95c2ee952a5301d4b346a5e8693350829d88b3c600048eedcf87bb00c23ee5fb",
 "stub": "95c2",
 "layer": "Physics",
 "type": "Primitives",
 "summary": "Mutual exclusion enforcement",
 "mechanism": "A synchronization primitive that enforces exclusive access to a resource. At most one holder may access the protected resource at any time. The holder must explicitly release the lock to allow others to acquire it.",
 "invariants": [
  "Exclusivity: At most one holder at any time.",
  "Acquire-before-access: Protected resource cannot be touched without holding the lock.",
  "Release-after-use: Holder must release after completing the critical section."
 ],
 "parameters": {},
 "signature": [],
 "preconditions": [
  "Shared resource exists",
  "Contending parties can communicate"
 ],
 "postconditions": [
  "Exactly one party holds exclusive access",
  "Other contenders are blocked or queued"
 ],
 "failure_modes": [
  "Deadlock: Holder crashes or hangs without releasing, blocking all other contenders indefinitely.",
  "Priority Inversion: High-priority contender blocked by low-priority holder."
 ],
 "domain": "",
 "caution": "Exclusive access — starvation enables denial of service.",
 "sources": [],
 "name": "Lock",
 "builds_on": [],
 "related": [],
 "used_by": [
  {
   "slug": "EbbFlowSync",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/EbbFlowSync"
  },
  {
   "slug": "Mutex",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Mutex"
  },
  {
   "slug": "StateLock",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/StateLock"
  },
  {
   "slug": "WorkerMode",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/WorkerMode"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/Lock",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/Lock.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
