Skip to content

Commit

Permalink
fix: add transition lock
Browse files Browse the repository at this point in the history
  • Loading branch information
pancsta committed Feb 22, 2024
1 parent 8cdfebb commit 2297f35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/machine/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ type Transition struct {

// newTransition creates a new transition for the given mutation.
func newTransition(m *Machine, item *Mutation) *Transition {
m.activeStatesLock.RLock()
defer m.activeStatesLock.RUnlock()

t := &Transition{
Mutation: item,
StatesBefore: m.ActiveStates,
Expand Down

0 comments on commit 2297f35

Please sign in to comment.