locker
locker copied to clipboard
Locker v2
Breaking changes:
- The minimum Go version is go1.19
- The result parameter to (*Locker).Unlock() has been dropped. Instead the application will crash with the same fatal run-time error as calling (sync.Mutex).Unlock() on an unlocked mutex.
- ErrNoSuchLock has been removed.
- New() has been removed. The zero value is valid.
Modernize the codebase by taking advantage of Go 1.19 atomics. Add an RWLocker for read-write locks. Add sync.Locker interface adapters for Locker and RWLocker.