mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-05-22 10:15:43 +02:00
5928e851dd
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>
56 lines
894 B
Go
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()
|
|
}
|