diff --git a/lualib/skynet.lua b/lualib/skynet.lua index 1f678548..b23fc35d 100644 --- a/lualib/skynet.lua +++ b/lualib/skynet.lua @@ -44,6 +44,11 @@ end -- suspend is local function function suspend(co, result, command, param, size) + local info = c.trace_yield(trace_handle) + if info then + local ti = c.trace_delete(trace_handle, info) + trace_func(info, ti) + end if not result then error(debug.traceback(co,command)) end @@ -256,11 +261,6 @@ local function dispatch_message(prototype, msg, sz, session, source, ...) error(string.format("Can't dispatch type %s : ", p.name)) end end - local info = c.trace_yield(trace_handle) - if info then - local ti = c.trace_delete(trace_handle, info) - trace_func(info, ti) - end while true do local key,co = next(fork_queue) if co == nil then