Refine comments

This commit is contained in:
Tevin 2018-09-08 12:35:14 +08:00 committed by GitHub
parent ae078ebcf7
commit 0bc71b68c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ func (ab *AtomicBool) IsSet() bool {
return atomic.LoadInt32((*int32)(ab)) == 1
}
// SetTo sets the boolean with given Boolean
// SetTo sets the Boolean with given Boolean.
func (ab *AtomicBool) SetTo(yes bool) {
if yes {
atomic.StoreInt32((*int32)(ab), 1)
@ -49,7 +49,7 @@ func (ab *AtomicBool) SetTo(yes bool) {
}
}
// Flip flips the boolean value whether the value is set or not
// Flip toggles the Boolean (replaces with its opposite value).
func (ab *AtomicBool) Flip() {
atomic.StoreInt32((*int32)(ab), atomic.LoadInt32((*int32)(ab))^1)
}