sync.Mutex: Lock()/Unlock() cho exclusive access (1 goroutine tại 1 thời điểm). sync.RWMutex: RLock() cho nhiều readers đồng thời, Lock() cho exclusive write.
- Dùng khi shared state giữa goroutines.
- Luôn
defer mu.Unlock(). - Tránh deadlock: lock order nhất quán.