mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
bugfix: wakeup sleep coroutine should return BREAK
This commit is contained in:
@@ -122,7 +122,7 @@ local function dispatch_wakeup()
|
|||||||
local session = sleep_session[co]
|
local session = sleep_session[co]
|
||||||
if session then
|
if session then
|
||||||
session_id_coroutine[session] = "BREAK"
|
session_id_coroutine[session] = "BREAK"
|
||||||
return suspend(co, coroutine.resume(co, true))
|
return suspend(co, coroutine.resume(co, true, "BREAK"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -246,7 +246,8 @@ function skynet.sleep(ti)
|
|||||||
session = tonumber(session)
|
session = tonumber(session)
|
||||||
local succ, ret = coroutine_yield("SLEEP", session)
|
local succ, ret = coroutine_yield("SLEEP", session)
|
||||||
sleep_session[coroutine.running()] = nil
|
sleep_session[coroutine.running()] = nil
|
||||||
if ret == true then
|
assert(succ, ret)
|
||||||
|
if ret == "BREAK" then
|
||||||
return "BREAK"
|
return "BREAK"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user