bugfix: socketchannel order mode may blocked. (used by redis driver)

This commit is contained in:
Cloud Wu
2015-10-14 20:12:30 +08:00
parent 7486e53232
commit c1c032eab4
4 changed files with 46 additions and 40 deletions

View File

@@ -275,10 +275,10 @@ function skynet.yield()
return skynet.sleep(0)
end
function skynet.wait()
function skynet.wait(co)
local session = c.genid()
local ret, msg = coroutine_yield("SLEEP", session)
local co = coroutine.running()
co = co or coroutine.running()
sleep_session[co] = nil
session_id_coroutine[session] = nil
end