# README
xsync
同步辅助函数
bool
、string
、time.Time
、int32
、int64
、uint32
、uint64
原子性操作sync.Cond
封装扩展- 支持设置指定
timeout
的sync.WaitGroup
例子
var b AtomicBool
fmt.Println(b.Get())
b.Set(true)
fmt.Println(b.Get())
Output:
false
true
# Functions
NewAtomicString creates a new String.
No description provided by the author
WaitContext performs a timed wait on a given sync.WaitGroup.
WaitTimeout performs a timed wait on a given sync.WaitGroup.
# Structs
AtomicBool is an atomic type-safe wrapper for bool values.
AtomicString is an atomic type-safe wrapper for string values.
AtomicTime is an atomic type-safe wrapper for time.Time values.
Cond is an alternate implementation of sync.Cond.
WaitGroupTimeout is a wrapper of sync.WaitGroup that supports wait with timeout.
# Type aliases
AtomicDuration is an atomic type-safe wrapper for duration values.
AtomicInt32 is an atomic type-safe wrapper for int32 values.
AtomicInt64 is an atomic type-safe wrapper for int64 values.
AtomicUint32 is an atomic type-safe wrapper for uint32 values.
AtomicUint64 is an atomic type-safe wrapper for uint64 values.