Skip to content

Commit

Permalink
chore: change mutex name to statusMutex
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulghangas committed Sep 28, 2022
1 parent de97176 commit 5b9e765
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extendeddatacrossword.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (eds *ExtendedDataSquare) solveCrossword(
// Track if a single iteration of this loop made progress
progressMade := false

var trackerMutex sync.Mutex
var statusMutex sync.Mutex
// Loop through every row and column, attempt to rebuild each row or column if incomplete
for i := 0; i < int(eds.width); i++ {
i := i
Expand All @@ -95,8 +95,8 @@ func (eds *ExtendedDataSquare) solveCrossword(
return err
}

trackerMutex.Lock()
defer trackerMutex.Unlock()
statusMutex.Lock()
defer statusMutex.Unlock()
solved = solved && solvedRow
progressMade = progressMade || progressMadeRow
return nil
Expand All @@ -116,8 +116,8 @@ func (eds *ExtendedDataSquare) solveCrossword(
return err
}

trackerMutex.Lock()
defer trackerMutex.Unlock()
statusMutex.Lock()
defer statusMutex.Unlock()
solved = solved && solvedCol
progressMade = progressMade || progressMadeCol
return nil
Expand Down

0 comments on commit 5b9e765

Please sign in to comment.