1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2026-05-22 10:15:43 +02:00
Files
lazygit/vendor/github.com/sasha-s/go-deadlock/sync_mutex_legacy.go
T
dependabot[bot] 5928e851dd Bump github.com/sasha-s/go-deadlock from 0.3.6 to 0.3.9
Bumps [github.com/sasha-s/go-deadlock](https://github.com/sasha-s/go-deadlock) from 0.3.6 to 0.3.9.
- [Release notes](https://github.com/sasha-s/go-deadlock/releases)
- [Commits](https://github.com/sasha-s/go-deadlock/compare/v0.3.6...v0.3.9)

---
updated-dependencies:
- dependency-name: github.com/sasha-s/go-deadlock
  dependency-version: 0.3.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 09:24:57 +00:00

68 lines
1.3 KiB
Go

//go:build !goexperiment.synctest && !deadlock_synctest && !deadlock_disable && !go1.18
// +build !goexperiment.synctest,!deadlock_synctest,!deadlock_disable,!go1.18
package deadlock
import "sync"
// StandardMutex wraps sync.Mutex
type StandardMutex struct {
mu sync.Mutex
}
func (m *StandardMutex) Lock() {
m.mu.Lock()
}
func (m *StandardMutex) Unlock() {
m.mu.Unlock()
}
func (m *StandardMutex) TryLock() bool {
// TryLock is not available before Go 1.18
panic("TryLock requires Go 1.18 or later")
}
// StandardRWMutex wraps sync.RWMutex
type StandardRWMutex struct {
mu sync.RWMutex
}
func (m *StandardRWMutex) Lock() {
m.mu.Lock()
}
func (m *StandardRWMutex) Unlock() {
m.mu.Unlock()
}
func (m *StandardRWMutex) RLock() {
m.mu.RLock()
}
func (m *StandardRWMutex) RUnlock() {
m.mu.RUnlock()
}
func (m *StandardRWMutex) TryLock() bool {
// TryLock is not available before Go 1.18
panic("TryLock requires Go 1.18 or later")
}
func (m *StandardRWMutex) TryRLock() bool {
// TryRLock is not available before Go 1.18
panic("TryRLock requires Go 1.18 or later")
}
func (m *StandardRWMutex) RLocker() sync.Locker {
return m.mu.RLocker()
}
// Default factory functions
func newStandardMutex() MutexImpl {
return &StandardMutex{}
}
func newStandardRWMutex() RWMutexImpl {
return &StandardRWMutex{}
}