diff --git a/README.md b/README.md index 883bc826..5bc80460 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Key Features: - support string, list, hash, set, sorted set - ttl -- publish/suscribe +- publish/subscribe - geo - aof and aof rewrite - Transaction. The `multi` command is Atomic and Isolated. If any errors are encountered during execution, godis will rollback the executed commands diff --git a/README_CN.md b/README_CN.md index d51b03d1..37b4f7e3 100644 --- a/README_CN.md +++ b/README_CN.md @@ -12,6 +12,7 @@ Godis 是一个用 Go 语言实现的 Redis 服务器。本项目旨在为尝试 关键功能: - 支持 string, list, hash, set, sorted set 数据结构 - 自动过期功能(TTL) +- 发布订阅 - 地理位置 - AOF 持久化及AOF重写 - 事务. Multi 命令开启的事务具有`原子性`和`隔离性`. 若在执行过程中遇到错误, godis 会回滚已执行的命令 diff --git a/datastruct/lock/lock_map.go b/datastruct/lock/lock_map.go index 427d68c0..068a6051 100644 --- a/datastruct/lock/lock_map.go +++ b/datastruct/lock/lock_map.go @@ -127,6 +127,7 @@ func (locks *Locks) RUnLocks(keys ...string) { } } +// RWLocks locks write keys and read keys together. allow duplicate keys func (locks *Locks) RWLocks(writeKeys []string, readKeys []string) { keys := append(writeKeys, readKeys...) indices := locks.toLockIndices(keys, false) @@ -146,6 +147,7 @@ func (locks *Locks) RWLocks(writeKeys []string, readKeys []string) { } } +// RWUnLocks unlocks write keys and read keys together. allow duplicate keys func (locks *Locks) RWUnLocks(writeKeys []string, readKeys []string) { keys := append(writeKeys, readKeys...) indices := locks.toLockIndices(keys, true)