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_disable_go118.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

56 lines
894 B
Go

//go:build deadlock_disable && go1.18
package deadlock
import "sync"
// StandardMutex wraps sync.Mutex with no deadlock detection
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 {
return m.mu.TryLock()
}
// StandardRWMutex wraps sync.RWMutex with no deadlock detection
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 {
return m.mu.TryLock()
}
func (m *StandardRWMutex) TryRLock() bool {
return m.mu.TryRLock()
}
func (m *StandardRWMutex) RLocker() sync.Locker {
return m.mu.RLocker()
}