Skip to content

Commit

Permalink
updatehub: lock state change mutex in cancel operation
Browse files Browse the repository at this point in the history
Signed-off-by: Luis Gustavo S. Barreto <gustavo@ossystems.com.br>
  • Loading branch information
gustavosbarreto authored and otavio committed Jul 31, 2018
1 parent 7bc6511 commit f5c07be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions updatehub/updatehub.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ func NewUpdateHub(
}

func (uh *UpdateHub) Cancel(nextState State) {
uh.stateMutex.Lock()
defer uh.stateMutex.Unlock()

uh.state.Cancel(true, nextState)
}

Expand Down

0 comments on commit f5c07be

Please sign in to comment.