1
0
mirror of https://github.com/natnat-mc/moonbuild synced 2026-05-14 06:51:14 +02:00

actually honor sync requests

This commit is contained in:
Codinget
2020-11-08 00:53:32 +01:00
parent e5bd85933a
commit 6a6334fc78
3 changed files with 29 additions and 0 deletions
+6
View File
@@ -12,6 +12,8 @@ nodepriority = (a, b) ->
tb = type b.name
da = #a.deps
db = #b.deps
sa = a.sync
sb = b.sync
if ta=='string' and tb!='string'
return true
elseif ta!='string' and tb=='string'
@@ -20,6 +22,10 @@ nodepriority = (a, b) ->
return true
elseif a.priority < b.priority
return false
elseif sa and not sb
return false
elseif sb and not sa
return true
else
return da < db
+8
View File
@@ -37,6 +37,14 @@ class Executor
error "Node #{name} wasn't built" unless node.built
addprocess: (node, opts) =>
if node.sync
while @nprocesses != 0
@waitprocess
node\build opts
node.built = true
node\updatecache!
return
pid = fork!
error "Failed to fork" unless pid
if pid!=0