# fatal error: sync: RUnlock of unlocked RWMutex

- **ID:** `go/mutex-unlock-of-unlocked-rwmutex`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

RUnlock() is called more times than RLock() on a sync.RWMutex, or RUnlock is called after a Lock (write lock) instead of RLock.

## Version Compatibility

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

## Workarounds

1. **** (98% success)
   ```
   mu.RLock()
defer mu.RUnlock()
// read section
   ```
2. **** (96% success)
   ```
   func (c *Cache) Get(k string) (V, bool) {
    c.mu.RLock()
    defer c.mu.RUnlock()
    v, ok := c.m[k]
    return v, ok
}
   ```

## Dead Ends

- **** — Removes read concurrency and may not fix the mismatched lock/unlock pattern. (80% fail)
- **** — Hides the bug and can leave the lock in an inconsistent state. (90% fail)
