token bugfix

This commit is contained in:
Cloud Wu
2018-06-07 16:10:57 +08:00
committed by 云风
parent 16d8f4c774
commit b1ec1f4d18

View File

@@ -228,7 +228,8 @@ end
function skynet.sleep(ti, token)
local session = c.intcommand("TIMEOUT",ti)
assert(session)
local succ, ret = suspend_sleep(session, token or coroutine.running())
token = token or coroutine.running()
local succ, ret = suspend_sleep(session, token)
sleep_session[token] = nil
if succ then
return
@@ -247,7 +248,7 @@ end
function skynet.wait(token)
local session = c.genid()
token = token or coroutine.running()
local ret, msg = suspend_sleep(session, token or coroutine.running())
local ret, msg = suspend_sleep(session, token)
sleep_session[token] = nil
session_id_coroutine[session] = nil
end