LuCId: Only count our own threads
This commit is contained in:
parent
45e20225a5
commit
c45930e05e
1 changed files with 6 additions and 4 deletions
|
@ -145,9 +145,11 @@ function run()
|
||||||
|
|
||||||
local pid, stat, code = nixio.wait(-1, "nohang")
|
local pid, stat, code = nixio.wait(-1, "nohang")
|
||||||
while pid and pid > 0 do
|
while pid and pid > 0 do
|
||||||
tcount = tcount - 1
|
if tpids[pid] then
|
||||||
if tpids[pid] and tpids[pid] ~= true then
|
tcount = tcount - 1
|
||||||
tpids[pid](pid, stat, code)
|
if tpids[pid] ~= true then
|
||||||
|
tpids[pid](pid, stat, code)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
pid, stat, code = nixio.wait(-1, "nohang")
|
pid, stat, code = nixio.wait(-1, "nohang")
|
||||||
end
|
end
|
||||||
|
@ -231,7 +233,7 @@ function create_process(threadcb, waitcb)
|
||||||
end
|
end
|
||||||
local pid, code, err = nixio.fork()
|
local pid, code, err = nixio.fork()
|
||||||
if pid and pid ~= 0 then
|
if pid and pid ~= 0 then
|
||||||
tpids[pid] = waitcb
|
tpids[pid] = waitcb or true
|
||||||
tcount = tcount + 1
|
tcount = tcount + 1
|
||||||
elseif pid == 0 then
|
elseif pid == 0 then
|
||||||
local code = threadcb()
|
local code = threadcb()
|
||||||
|
|
Loading…
Reference in a new issue