From 6ce12d11803e0b5e9714c300ccf0160dbbca33e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Mon, 17 Sep 2012 10:25:20 +0800 Subject: [PATCH] move trace into suspend --- lualib/skynet.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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