修复读锁释放错误

This commit is contained in:
白茶清欢 2021-04-01 20:17:30 +08:00
parent 5312092ad6
commit 91894a6f96
2 changed files with 2 additions and 3 deletions

View File

@ -44,14 +44,13 @@ func (l *lock) Unlock(optionFuncList ...OptionFunc) error {
func (l *lock) RLock(optionFuncList ...OptionFunc) error { func (l *lock) RLock(optionFuncList ...OptionFunc) error {
defer l.AddRLockCnt(l.lockCnt) defer l.AddRLockCnt(l.lockCnt)
l.sc.RLock() l.sc.RLock()
return nil return nil
} }
func (l *lock) RUnlock(optionFuncList ...OptionFunc) error { func (l *lock) RUnlock(optionFuncList ...OptionFunc) error {
defer l.DecreaseRLockCnt(l.lockCnt) defer l.DecreaseRLockCnt(l.lockCnt)
l.sc.Unlock() l.sc.RUnlock()
return nil return nil
} }

View File

@ -43,6 +43,6 @@ func GenRandomString(source string, length uint) string {
// Date : 6:01 下午 2021/3/9 // Date : 6:01 下午 2021/3/9
func Md5(str string) string { func Md5(str string) string {
h := md5.New() h := md5.New()
h.Write([]byte(str)) _, _ = h.Write([]byte(str))
return hex.EncodeToString(h.Sum(nil)) return hex.EncodeToString(h.Sum(nil))
} }