libs/cbi: properly handle .default for dummy values
[project/luci.git] / libs / lucid / luasrc / lucid.lua
index e1d73227f1cc4ca8c5bdce63fe4d39df688fdb4b..5d62a6cd8f4a1bfae01598fbb434eb3302c9919a 100644 (file)
@@ -145,9 +145,12 @@ function run()
                
                local pid, stat, code = nixio.wait(-1, "nohang")
                while pid and pid > 0 do
-                       tcount = tcount - 1
-                       if tpids[pid] and tpids[pid] ~= true then
-                               tpids[pid](pid, stat, code)
+                       nixio.syslog("info", "Buried thread: " .. pid)
+                       if tpids[pid] then
+                               tcount = tcount - 1
+                               if tpids[pid] ~= true then
+                                       tpids[pid](pid, stat, code)
+                               end
                        end
                        pid, stat, code = nixio.wait(-1, "nohang")
                end
@@ -231,7 +234,8 @@ function create_process(threadcb, waitcb)
        end
        local pid, code, err = nixio.fork()
        if pid and pid ~= 0 then
-               tpids[pid] = waitcb
+               nixio.syslog("info", "Created thread: " .. pid)
+               tpids[pid] = waitcb or true
                tcount = tcount + 1
        elseif pid == 0 then
                local code = threadcb()