diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-07 09:44:50 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-07 11:16:14 +1000 |
commit | 755ae0ef846d6a42678d0b8cb2c37108f79a0458 (patch) | |
tree | 8ef20b395f85fa174c122665ca46eb2d7d9b7ff4 /pkg/gui/context/patch_explorer_context.go | |
parent | 7410acd1aaa97f678295a328264360802346b33a (diff) |
add deadlock mutex package
write to deadlock stderr after closing gocui
more deadlock checking
Diffstat (limited to 'pkg/gui/context/patch_explorer_context.go')
-rw-r--r-- | pkg/gui/context/patch_explorer_context.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pkg/gui/context/patch_explorer_context.go b/pkg/gui/context/patch_explorer_context.go index a8ad45bbb..3e13b8539 100644 --- a/pkg/gui/context/patch_explorer_context.go +++ b/pkg/gui/context/patch_explorer_context.go @@ -1,11 +1,10 @@ package context import ( - "sync" - "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/gui/patch_exploring" "github.com/jesseduffield/lazygit/pkg/gui/types" + deadlock "github.com/sasha-s/go-deadlock" ) type PatchExplorerContext struct { @@ -15,7 +14,7 @@ type PatchExplorerContext struct { viewTrait *ViewTrait getIncludedLineIndices func() []int c *types.HelperCommon - mutex *sync.Mutex + mutex *deadlock.Mutex } var _ types.IPatchExplorerContext = (*PatchExplorerContext)(nil) @@ -35,7 +34,7 @@ func NewPatchExplorerContext( state: nil, viewTrait: NewViewTrait(view), c: c, - mutex: &sync.Mutex{}, + mutex: &deadlock.Mutex{}, getIncludedLineIndices: getIncludedLineIndices, SimpleContext: NewSimpleContext(NewBaseContext(NewBaseContextOpts{ View: view, @@ -124,6 +123,6 @@ func (self *PatchExplorerContext) NavigateTo(isFocused bool, selectedLineIdx int return self.RenderAndFocus(isFocused) } -func (self *PatchExplorerContext) GetMutex() *sync.Mutex { +func (self *PatchExplorerContext) GetMutex() *deadlock.Mutex { return self.mutex } |