:: Re: [DNG] Doing away with multi-thr…
Forside
Slet denne besked
Besvar denne besked
Skribent: tilt!
Dato:  
Til: dng
Emne: Re: [DNG] Doing away with multi-threading in my project (netman)
Sorry,

come to think about it, simply return if rv is -1,
because that means there are no un-waited children left.

You should definately first fix the pcint Status issue,
because if you give an invalid argument ot waitpid, it
returns -1 and sets errno to EINVAL.

while true
     rv := waitpid(-1, Status, WNOHANG);


     if rv=-1
        if fpGetErrno <> ECHILD the
           report "ERROR: unexpected error: " fpGetErrno
        return;
     else if rv<>0
        report "DEBUG: pid " rv " exited with status " Status
        continue;
end; {* while true *}


Best regards,
T.