diff --git a/lualib/skynet/require.lua b/lualib/skynet/require.lua index b902af13..f814c3fc 100644 --- a/lualib/skynet/require.lua +++ b/lualib/skynet/require.lua @@ -43,6 +43,7 @@ do local loading_queue = loading[name] if loading_queue then + assert(loading_queue.co ~= co, "circular dependency") -- Module is in the init process (require the same mod at the same time in different coroutines) , waiting. local skynet = require "skynet" loading_queue[#loading_queue+1] = co @@ -54,7 +55,7 @@ do return m end - loading_queue = {} + loading_queue = {co = co} loading[name] = loading_queue local old_init_list = context[co]