diff --git a/lualib/redis.lua b/lualib/redis.lua index 9c573a73..86be9002 100644 --- a/lualib/redis.lua +++ b/lualib/redis.lua @@ -155,8 +155,8 @@ function command:batch(mode) allok = allok and ok allret[i] = ret end - assert(allok, "batch read failed") socket.unlock(self.__handle) + assert(allok, "batch read failed") self.__mode = false return allret else diff --git a/lualib/socket.lua b/lualib/socket.lua index fc075f9f..8ba000ca 100644 --- a/lualib/socket.lua +++ b/lualib/socket.lua @@ -142,7 +142,6 @@ function socket.accept(id) end function socket.close(fd) --- socket.lock(fd) local s = socket_pool[id] if s == nil then return @@ -154,6 +153,7 @@ function socket.close(fd) if s.buffer then driver.clear(s.buffer) end + assert(s.lock_set == nil or next(s.lock_set) == nil) socket_pool[id] = nil end