Skip to content

Commit c59605d

Browse files
committed
fix read/write locks
1 parent 368def5 commit c59605d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,13 +469,13 @@ func newSafeBool(value bool) *safeBool {
469469
}
470470

471471
func (s *safeBool) set(value bool) {
472-
s.RLock()
473-
defer s.RUnlock()
472+
s.Lock()
473+
defer s.Unlock()
474474
s.value = value
475475
}
476476

477477
func (s *safeBool) bool() bool {
478-
s.Lock()
479-
defer s.Unlock()
478+
s.RLock()
479+
defer s.RUnlock()
480480
return s.value
481481
}

0 commit comments

Comments
 (0)