Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
fix condition conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
bootjp committed Jul 12, 2020
1 parent 74a2977 commit 8c05dc6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func welcomeScreen(a fyne.App, v vrcarjt.AutoRejoin, w fyne.Window) fyne.CanvasO

widget.NewGroup("Controls",
fyne.NewContainerWithLayout(layout.NewGridLayout(2),
widget.NewButton("Status: Start", func() {
widget.NewButton("Start", func() {
if v.IsRun() {
return
}
Expand Down
14 changes: 10 additions & 4 deletions vrc_auto_rejoin_tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,19 @@ func (v *VRCAutoRejoinTool) Run() error {
ok, err := lock.Try()

if err != nil || !ok {
v.lock.Lock()
v.running = false
v.lock.Unlock()
return ErrDuplicateRun
}

if err = lock.Lock(); err != nil {
v.lock.Lock()
v.running = false
v.lock.Unlock()
return err
}

v.lock.Lock()
v.running = true
v.lock.Unlock()

defer lock.UnLock()
v.setupTimeLocation()

Expand All @@ -157,6 +159,10 @@ func (v *VRCAutoRejoinTool) Run() error {
return err
}

v.lock.Lock()
v.running = true
v.lock.Unlock()

v.playAudioFile("start.wav")
v.wait.Add(1)

Expand Down

0 comments on commit 8c05dc6

Please sign in to comment.