Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReMutex ¶
type ReMutex struct {
// contains filtered or unexported fields
}
ReMutex doc @Struct ReMutex @Summary Reentrant mutex
type ReSpinLock ¶
type ReSpinLock struct {
// contains filtered or unexported fields
}
ReSpinLock doc @Struct ReSpinLock @Summary Re-entrant spin lock
func (*ReSpinLock) Trylock ¶
func (slf *ReSpinLock) Trylock() bool
Trylock doc @Method Trylock doc : Try to lock if you fail to get the lock return failure will not try again @Return (bool)
func (*ReSpinLock) Unlock ¶
func (slf *ReSpinLock) Unlock()
Unlock doc @Method Unlock @Summary unlocking
func (*ReSpinLock) Width ¶
func (slf *ReSpinLock) Width(m *SpinLock)
Width doc @Method Width doc : Spinlock association reentrant spin lock @Param (*SpinLock) width spinlock object
type RedisMethodDo ¶
RedisMethodDo doc @type (func(commandName string, args ...interface{}) (interface{}, error))
type RedisMutex ¶
type RedisMutex struct {
// contains filtered or unexported fields
}
RedisMutex doc @Summary redis mutex object @Member (string) resource @Member (string) token @Member (int) timeout
func TryRedisLock ¶
func TryRedisLock(doFun RedisMethodDo, resouse string, token string, timeout int) (m *RedisMutex, ok bool, err error)
TryRedisLock Try to acquire a lock @Summary Try to acquire a locking @Param (RedisMethodDo) redis do function @Param (string) lock object(key/name) @Param (string) lock token @Param (int) lock timeout millsec @Return (*RedisMutex) redis mutex object @Return (bool) redis lock is success @Return (error) redis lock fail error informat
func TryRedisLockWithTimeOut ¶
func TryRedisLockWithTimeOut(doFun RedisMethodDo, resouse string, token string, timeout int) (m *RedisMutex, ok bool, err error)
TryRedisLockWithTimeOut doc @Summary Try to acquire the lock and set the lock timeout @Param (RedisMethodDo) redis do function @Param (string) lock object(key/name) @Param (string) lock token @Param (int) lock timeout millsec @Return (*RedisMutex) redis mutex object @Return (bool) redis lock is success @Return (error) redis lock fail error informat
func (*RedisMutex) AddTimeOut ¶
func (slf *RedisMutex) AddTimeOut(exTime int64) (ok bool, err error)
AddTimeOut doc @Summary rest/append lock timeout time @Param (int64) setting/append time @Return (bool) @reutrn (error)
func (*RedisMutex) Unlock ¶
func (slf *RedisMutex) Unlock() (err error)
Unlock doc @Method Unlock @Summary unlocking @Return (error) unlock fail returns error informat