Update split SDK to 6.0.2 to fix sync bug (#17060)

* Update split SDK to 6.0.2 to fix sync bug

* Vendor and tidy
Этот коммит содержится в:
Joram Wilander
2021-03-04 11:16:08 -05:00
коммит произвёл GitHub
родитель fa2ecad0a9
Коммит aba00a3cfd
150 изменённых файлов: 2500 добавлений и 1960 удалений

41
vendor/github.com/splitio/go-toolkit/v4/sync/atomicbool.go сгенерированный поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,41 @@
package sync
import (
"sync/atomic"
)
const (
falseValue = 0
trueValue = 1
)
type AtomicBool struct {
value uint32
}
func (b *AtomicBool) Set() {
atomic.StoreUint32(&b.value, trueValue)
}
func (b *AtomicBool) Unset() {
atomic.StoreUint32(&b.value, falseValue)
}
func (b *AtomicBool) IsSet() bool {
return atomic.LoadUint32(&b.value) == trueValue
}
func (b *AtomicBool) TestAndSet() bool {
return atomic.CompareAndSwapUint32(&b.value, falseValue, trueValue)
}
func (b *AtomicBool) TestAndClear() bool {
return atomic.CompareAndSwapUint32(&b.value, trueValue, falseValue)
}
func NewAtomicBool(initialValue bool) *AtomicBool {
if initialValue {
return &AtomicBool{value: trueValue}
}
return &AtomicBool{}
}