Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bool_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func boolToInt(b bool) uint32 {
func (b *Bool) Toggle() (old bool) {
for {
old := b.Load()
if b.CAS(old, !old) {
if b.CompareAndSwap(old, !old) {
return old
}
}
Expand Down
2 changes: 1 addition & 1 deletion float32_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (f *Float32) Add(delta float32) float32 {
for {
old := f.Load()
new := old + delta
if f.CAS(old, new) {
if f.CompareAndSwap(old, new) {
return new
}
}
Expand Down
2 changes: 1 addition & 1 deletion float64_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (f *Float64) Add(delta float64) float64 {
for {
old := f.Load()
new := old + delta
if f.CAS(old, new) {
if f.CompareAndSwap(old, new) {
return new
}
}
Expand Down