mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
when skynet.init require the loading module caused circular dependency (#1403)
This commit is contained in:
@@ -43,6 +43,7 @@ do
|
|||||||
|
|
||||||
local loading_queue = loading[name]
|
local loading_queue = loading[name]
|
||||||
if loading_queue then
|
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.
|
-- Module is in the init process (require the same mod at the same time in different coroutines) , waiting.
|
||||||
local skynet = require "skynet"
|
local skynet = require "skynet"
|
||||||
loading_queue[#loading_queue+1] = co
|
loading_queue[#loading_queue+1] = co
|
||||||
@@ -54,7 +55,7 @@ do
|
|||||||
return m
|
return m
|
||||||
end
|
end
|
||||||
|
|
||||||
loading_queue = {}
|
loading_queue = {co = co}
|
||||||
loading[name] = loading_queue
|
loading[name] = loading_queue
|
||||||
|
|
||||||
local old_init_list = context[co]
|
local old_init_list = context[co]
|
||||||
|
|||||||
Reference in New Issue
Block a user