{
  "handle": "Lock",
  "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.",
  "gloss": "Mutual exclusion enforcement",
  "failure_modes": [
    "Deadlock: Holder crashes or hangs without releasing, blocking all other contenders indefinitely.",
    "Priority Inversion: High-priority contender blocked by low-priority holder."
  ],
  "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."
  ],
  "preconditions": [
    "Shared resource exists",
    "Contending parties can communicate"
  ],
  "postconditions": [
    "Exactly one party holds exclusive access",
    "Other contenders are blocked or queued"
  ],
  "_meta": {
    "tier": 1,
    "ring": 0,
    "caution": "Exclusive access — starvation enables denial of service.",
    "path": [
      "Physics",
      "Primitives"
    ]
  },
  "sema_ref": "Lock#95c2",
  "sema_id": "sema:Lock#mh:SHA-256:95c2ee952a5301d4b346a5e8693350829d88b3c600048eedcf87bb00c23ee5fb",
  "sema_stub": "95c2",
  "sema_layer": "Physics",
  "sema_category": "Primitives",
  "used_by": {
    "references": {
      "EbbFlowSync": "sema:EbbFlowSync#mh:SHA-256:c68ee6aee66d266b40bf18152658a65d26e210aac458011629d39b131f3461f7",
      "Mutex": "sema:Mutex#mh:SHA-256:b031c2dc75f23526ac765e042cd1ff77f66f0a7a23d57e480b30da0a8343e18e",
      "StateLock": "sema:StateLock#mh:SHA-256:c9c2809bdf97bb6ac17a8ffe428d4aa9a28294b99d64cc8a336a239d26a8afb8",
      "WorkerMode": "sema:WorkerMode#mh:SHA-256:ba4708992ae8c4469b3c98e025829fafa8caf6430f1da66ed74b50a8e9255990"
    },
    "extends": {
      "Mutex": "sema:Mutex#mh:SHA-256:b031c2dc75f23526ac765e042cd1ff77f66f0a7a23d57e480b30da0a8343e18e"
    }
  }
}
