mirror of https://github.com/tevino/abool.git
Complete the implementation of toggle
This commit is contained in:
parent
9c19061983
commit
4bc34b54a1
2
bool.go
2
bool.go
|
@ -37,7 +37,7 @@ func (ab *AtomicBool) UnSet() {
|
||||||
|
|
||||||
// IsSet returns whether the Boolean is true
|
// IsSet returns whether the Boolean is true
|
||||||
func (ab *AtomicBool) IsSet() bool {
|
func (ab *AtomicBool) IsSet() bool {
|
||||||
return atomic.LoadInt32((*int32)(ab)) == 1
|
return atomic.LoadInt32((*int32)(ab))&1 == 1
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetTo sets the boolean with given Boolean.
|
// SetTo sets the boolean with given Boolean.
|
||||||
|
|
Loading…
Reference in New Issue