Skip to content

Commit

Permalink
update .gitignore and fix unlock command bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wujunwei committed Jan 30, 2020
1 parent 8084e46 commit 2846052
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.o
*.ko
*.obj
*.xo
*.elf

# Linker output
Expand Down
2 changes: 1 addition & 1 deletion slock.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int SlockRUnLock_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int
}
SLock *lock;
lock = RedisModule_ModuleTypeGetValue(key);
if (lock->is_write) {
if (!lock->is_write) {
if (--lock->reader_count <= 0) {
RedisModule_DeleteKey(key);
}
Expand Down

0 comments on commit 2846052

Please sign in to comment.