mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
redis driver: unlock before assert failed
This commit is contained in:
@@ -155,8 +155,8 @@ function command:batch(mode)
|
|||||||
allok = allok and ok
|
allok = allok and ok
|
||||||
allret[i] = ret
|
allret[i] = ret
|
||||||
end
|
end
|
||||||
assert(allok, "batch read failed")
|
|
||||||
socket.unlock(self.__handle)
|
socket.unlock(self.__handle)
|
||||||
|
assert(allok, "batch read failed")
|
||||||
self.__mode = false
|
self.__mode = false
|
||||||
return allret
|
return allret
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ function socket.accept(id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function socket.close(fd)
|
function socket.close(fd)
|
||||||
-- socket.lock(fd)
|
|
||||||
local s = socket_pool[id]
|
local s = socket_pool[id]
|
||||||
if s == nil then
|
if s == nil then
|
||||||
return
|
return
|
||||||
@@ -154,6 +153,7 @@ function socket.close(fd)
|
|||||||
if s.buffer then
|
if s.buffer then
|
||||||
driver.clear(s.buffer)
|
driver.clear(s.buffer)
|
||||||
end
|
end
|
||||||
|
assert(s.lock_set == nil or next(s.lock_set) == nil)
|
||||||
socket_pool[id] = nil
|
socket_pool[id] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user