ha: update godoc on grabLockOrStop (#10547)

This commit is contained in:
Calvin Leung Huang 2020-12-11 16:04:00 -08:00 committed by GitHub
parent 0bc11e89c6
commit 30eeac6501
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -637,7 +637,9 @@ func (c *Core) waitForLeadership(newLeaderCh chan func(), manualStepDownCh, stop
// grabLockOrStop returns stopped=false if the lock is acquired. Returns
// stopped=true if the lock is not acquired, because stopCh was closed. If the
// lock was acquired (stopped=false) then it's up to the caller to unlock.
// lock was acquired (stopped=false) then it's up to the caller to unlock. If
// the lock was not acquired (stopped=true), the caller does not hold the lock and
// should not call unlock.
func grabLockOrStop(lockFunc, unlockFunc func(), stopCh chan struct{}) (stopped bool) {
// lock protects these variables which are shared by parent and child.
var lock sync.Mutex