summaryrefslogtreecommitdiff
path: root/xmake/modules/lib
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-05 00:39:54 +0800
committerruki <[email protected]>2020-02-07 22:45:56 +0800
commit35b8b34362abe28a638af8ee02d3babe8e3548e2 (patch)
treea47c0a1da53fffd81f0aa7832ceb3646950bd08a /xmake/modules/lib
parent94d3eb649e489a597a2f5d966d2249a9e64d87e3 (diff)
uses new runjobs
Diffstat (limited to 'xmake/modules/lib')
-rw-r--r--xmake/modules/lib/detect/features.lua5
-rw-r--r--xmake/modules/lib/detect/has_flags.lua5
2 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/lib/detect/features.lua b/xmake/modules/lib/detect/features.lua
index e07c89923..60799c667 100644
--- a/xmake/modules/lib/detect/features.lua
+++ b/xmake/modules/lib/detect/features.lua
@@ -20,6 +20,7 @@
-- imports
import("lib.detect.find_tool")
+import("core.base.scheduler")
-- get all features of the current tool
--
@@ -57,11 +58,11 @@ function main(name, opt)
local results = _g._RESULTS
-- @note avoid detect the same program in the same time if running in the coroutine (e.g. ccache)
- local coroutine_running = coroutine.running()
+ local coroutine_running = scheduler.co_running()
if coroutine_running then
while _g._checking ~= nil and _g._checking == key do
local curdir = os.curdir()
- coroutine.yield()
+ scheduler.co_yield()
os.cd(curdir)
end
end
diff --git a/xmake/modules/lib/detect/has_flags.lua b/xmake/modules/lib/detect/has_flags.lua
index 1bb96e21d..1abf466a7 100644
--- a/xmake/modules/lib/detect/has_flags.lua
+++ b/xmake/modules/lib/detect/has_flags.lua
@@ -20,6 +20,7 @@
-- imports
import("core.base.option")
+import("core.base.scheduler")
import("core.project.config")
import("lib.detect.cache")
import("lib.detect.find_tool")
@@ -74,11 +75,11 @@ function main(name, flags, opt)
local key = plat .. "_" .. arch .. "_" .. tool.program .. "_" .. (tool.version or "") .. "_" .. (opt.toolkind or "") .. "_" .. (opt.flagkind or "") .. "_" .. table.concat(opt.sysflags, " ") .. "_" .. opt.flagskey
-- @note avoid detect the same program in the same time if running in the coroutine (e.g. ccache)
- local coroutine_running = coroutine.running()
+ local coroutine_running = scheduler.co_running()
if coroutine_running then
while _g._checking ~= nil and _g._checking == key do
local curdir = os.curdir()
- coroutine.yield()
+ scheduler.co_yield()
os.cd(curdir)
end
end