diff --git a/.gitignore b/.gitignore index e23186a..c56592e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.o *.ko *.obj +*.xo *.elf # Linker output diff --git a/slock.c b/slock.c index 4e6f351..d0de517 100644 --- a/slock.c +++ b/slock.c @@ -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); }