# panic: sync: RUnlock of unlocked RWMutex

- **ID:** `go/rwmutex-unlock-without-lock`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

RUnlock() was called without a matching RLock(), or the mutex was locked for writing instead. Mismatched lock/unlock pairs on RWMutex panic.

## Version Compatibility

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

## Workarounds

1. **** (94% success)
   ```
   mu.RLock()
defer mu.RUnlock()
// read-only access
   ```
2. **** (90% success)
   ```
   func (s *Store) Get(k string) (V, bool) {
    s.mu.RLock()
    defer s.mu.RUnlock()
    v, ok := s.m[k]
    return v, ok
}
   ```

## Dead Ends

- **** — Loses read concurrency benefits and may not fix the underlying mismatched lock/unlock logic. (70% fail)
- **** — Hides the bug; the RWMutex internal state may be inconsistent, leading to deadlocks later. (88% fail)
