# fatal error: sync: RUnlock of unlocked RWMutex

- **ID:** `go/mutex-lock-of-locked`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

RWMutex.RUnlock() called without a matching RLock, often from a defer in a branch that never took the read lock, or from a panic path that skipped RLock.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0+ | active | — | — |

## Workarounds

1. **** (96% success)
   ```
   func read() {
    mu.RLock()
    defer mu.RUnlock()
    // read-only work
}
   ```
2. **** (94% success)
   ```
   func withRLock(mu *sync.RWMutex, fn func()) {
    mu.RLock()
    defer mu.RUnlock()
    fn()
}
   ```

## Dead Ends

- **** — The mismatched Unlock remains and now triggers 'unlock of unlocked mutex' instead. (90% fail)
- **** — More error-prone; panics now leave the lock held, causing deadlocks. (85% fail)
