move trace into suspend

This commit is contained in:
云风
2012-09-17 10:25:20 +08:00
parent d4b92a92a8
commit 6ce12d1180

View File

@@ -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