Documentation
¶
Overview ¶
Package lock 分布式锁实现 分布式锁需要有客户端信息,只可以获得锁的客户端自己解锁或者等待锁自己过期 当未能获得锁需要等待锁释放时可以通过wait接口实现
Index ¶
Constants ¶
View Source
const DefaultCheckPeriod = 500 * time.Microsecond
DefaultCheckPeriod 等待的轮询间隔默认500微秒
View Source
const MiniCheckPeriod = 100 * time.Microsecond
MiniCheckPeriod 等待的轮询间隔最低100微秒
Variables ¶
View Source
var ErrAlreadyLocked = errors.New("该锁已经被锁定")
ErrAlreadyLocked 该锁已经被锁定
View Source
var ErrAlreadyUnLocked = errors.New("该锁已经被解锁")
ErrAlreadyUnLocked 该锁已经被解锁
View Source
var ErrArgCheckPeriodMoreThan1 = errors.New("checkperiod必须只有1位或者没有设置")
ErrArgCheckPeriodMoreThan1 checkperiod参数的个数超过1个
View Source
var ErrCheckPeriodLessThan100Microsecond = errors.New("checkperiod 必须不小于100微秒")
ErrCheckPeriodLessThan100Microsecond checkperiod小于100微秒
View Source
var ErrNoRightToUnLocked = errors.New("无权解锁该锁")
ErrNoRightToUnLocked 无权解锁该锁
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.