1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

add deadlock mutex package

write to deadlock stderr after closing gocui

more deadlock checking
This commit is contained in:
Jesse Duffield
2022-08-07 09:44:50 +10:00
parent 7410acd1aa
commit 755ae0ef84
44 changed files with 1635 additions and 57 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
"github.com/jesseduffield/lazygit/pkg/utils"
"github.com/sasha-s/go-deadlock"
"github.com/sirupsen/logrus"
)
@ -34,8 +35,8 @@ type ViewBufferManager struct {
// this is what we write the output of the task to. It's typically a view
writer io.Writer
waitingMutex sync.Mutex
taskIDMutex sync.Mutex
waitingMutex deadlock.Mutex
taskIDMutex deadlock.Mutex
Log *logrus.Entry
newTaskID int
readLines chan int
@ -126,7 +127,7 @@ func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), p
}
})
loadingMutex := sync.Mutex{}
loadingMutex := deadlock.Mutex{}
// not sure if it's the right move to redefine this or not
self.readLines = make(chan int, 1024)