redis driver: unlock before assert failed

This commit is contained in:
云风
2013-08-22 18:09:45 +08:00
parent e074076c8d
commit 4d8390ba66
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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