From 2166bae734d509795a6568aece5afeba8c4262eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 21 Jan 2019 16:05:22 +0800 Subject: =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=84=9A=E6=9C=AC=E6=97=B6=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=96=B0=E7=9A=84=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/vm.lua | 3 +++ server/src/service.lua | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua index 4adc5044..99e92fe5 100644 --- a/server/src/core/vm.lua +++ b/server/src/core/vm.lua @@ -1436,6 +1436,9 @@ end function mt:doActions(actions) for _, action in ipairs(actions) do self:doAction(action) + if coroutine.isyieldable() then + coroutine.yield() + end end end diff --git a/server/src/service.lua b/server/src/service.lua index dc680ec0..0986aa9f 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -385,11 +385,12 @@ function mt:_doCompileTask() if not suc then break end - if coroutine.status(self._compileTask) == 'dead' then + if coroutine.status(self._compileTask) == 'suspended' then + self:_loadProto() + else self._compileTask = nil - break + return end - self:_loadProto() end end -- cgit v1.2.3