when skynet.init require the loading module caused circular dependency (#1403)

This commit is contained in:
t0350
2021-05-16 22:26:39 +08:00
committed by GitHub
parent 28d47d96b9
commit 6ad8da0993

View File

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