Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtomTotaliser ¶
type AtomTotaliser struct {
// contains filtered or unexported fields
}
func (*AtomTotaliser) Add ¶
func (this *AtomTotaliser) Add(id string, amount int32)
func (*AtomTotaliser) ResetAll ¶
func (this *AtomTotaliser) ResetAll() (ids []string, amounts []int32)
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
Int32 atomic.Int32,用于引用计数+1-1
func (*Int32) CompareAndSwap ¶
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 atomic.Int64,用于引用计数+1-1
func (*Int64) CompareAndSwap ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
---------------type Mutex struct------------------------------------------------------------------------- 标准互斥锁封装,不支持递归(嵌套)Lock
type RWMutex ¶
type RWMutex struct {
// contains filtered or unexported fields
}
---------------type RWMutex struct------------------------------------------------------------------------- 标准读写锁封装,不支持递归(嵌套)读Lock、不支持递归(嵌套)写Lock
type RWMutex2 ¶
type RWMutex2 struct {
// contains filtered or unexported fields
}
---------------type RWMutex2 struct------------------------------------------------------------------------- 简单实现的读写锁2,支持递归读Lock、不支持递归写Lock
type RWMutex3 ¶
type RWMutex3 struct {
// contains filtered or unexported fields
}
---------------type RWMutex3 struct------------------------------------------------------------------------- 完美(功能)实现的读写锁3,支持无限递归(嵌套)写和无限递归(嵌套)读Lock,被读嵌套的写在写解锁时候会原子的过度到读(不会被其他写打断)