Skip to content

Commit

Permalink
fix read/write locks
Browse files Browse the repository at this point in the history
  • Loading branch information
jcox250 committed Apr 7, 2022
1 parent 368def5 commit c59605d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,13 @@ func newSafeBool(value bool) *safeBool {
}

func (s *safeBool) set(value bool) {
s.RLock()
defer s.RUnlock()
s.Lock()
defer s.Unlock()
s.value = value
}

func (s *safeBool) bool() bool {
s.Lock()
defer s.Unlock()
s.RLock()
defer s.RUnlock()
return s.value
}

0 comments on commit c59605d

Please sign in to comment.