# fatal error: semacquire: semacquire

goroutine 1 [semacquire]:
sync.runtime_Semacquire(...)

- **ID:** `go/semacquire-deadlock`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A sync primitive (Mutex, WaitGroup, RWMutex) is held or waited on such that no progress is possible; runtime reports semacquire deadlock.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.18 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   // Always lock A then B, never B then A.
muA.Lock(); muB.Lock(); ...; muB.Unlock(); muA.Unlock()
   ```
2. **** (80% success)
   ```
   if !mu.TryLock() {
    return errors.New("lock timeout")
}
defer mu.Unlock()
   ```

## Dead Ends

- **** — Atomics cannot express compound invariants; logic still deadlocks. (85% fail)
- **** — Does not resolve lock ordering; can still deadlock. (90% fail)
